/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class PerfDataEntry {
private class EntryFieldOffset {
}
private int entryStart;
private int entryLength;
private int vectorLength;
private int flags;
private int dataOffset;
private int dataSize;
entryStart = b.position();
entryLength = b.getInt();
// check for valid entry length
throw new InstrumentationException("Invalid entry length: " +
" entryLength = " + entryLength);
}
// check if last entry occurs before the eof.
throw new InstrumentationException("Entry extends beyond end of buffer: " +
" entryStart = " + entryStart +
" entryLength = " + entryLength +
" buffer limit = " + b.limit());
}
int nameOffset = b.getInt();
throw new InstrumentationException("Invalid name offset: " +
" entryStart = " + entryStart +
" nameOffset = " + nameOffset +
" buffer limit = " + b.limit());
}
vectorLength = b.getInt();
dataOffset = b.getInt();
// read in the perfData item name, casting bytes to chars. skip the
// null terminator
// calculate the length of the name
int nameLength = 0;
byte c;
byte[] symbolBytes = new byte[nameLength];
for (int i = 0; i < nameLength; i++) {
symbolBytes[i] = b.get();
}
// convert name into a String
try {
}
catch (UnsupportedEncodingException e) {
// should not reach here
// "UTF-8" is always a known encoding
throw new InternalError(e.getMessage());
}
throw new InstrumentationException("Invalid variability attribute:" +
" name = " + name);
}
throw new InstrumentationException("Invalid units attribute: " +
" name = " + name);
}
if (vectorLength > 0) {
} else {
}
// check if data beyond the eof.
throw new InstrumentationException("Data extends beyond end of buffer: " +
" entryStart = " + entryStart +
" dataOffset = " + dataOffset+
" dataSize = " + dataSize +
" buffer limit = " + b.limit());
}
// Construct a ByteBuffer for the data
}
public int size() {
return entryLength;
}
return name;
}
return dataType;
}
return unit;
}
public int flags() {
return flags;
}
/**
* Returns the number of elements in the data.
*/
public int vectorLength() {
return vectorLength;
}
return variability;
}
}
return lb;
}
}