/*
* 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.
*
* 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.
*
*/
#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "code/codeBlob.hpp"
#include "memory/allocation.hpp"
#include "runtime/dtraceJSDT.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/signature.hpp"
#include "utilities/globalDefinitions.hpp"
#ifdef HAVE_DTRACE_H
#include <fcntl.h>
#include <unistd.h>
#include <dtrace.h>
static int dofhelper_open() {
int fd;
// Optimize next calls
return -1;
}
}
return fd;
}
int probe;
int fd;
fd = dofhelper_open();
if (fd < 0)
return -1;
if (PrintDTraceDOF) {
printDOFHelper(&dh);
}
return probe;
}
// We need sections:
// (1) STRTAB
// (
// (2) PROVIDER
// (3) PROBES
// (4) PROBOFFS
// (5) PROBARGS
// ) * Number of Providers
// Type of sections we create
enum {
STRTAB = 0,
};
// Store offsets of all strings here in such order:
// zero-string (always 0)
// provider1-name
// probe1-function
// probe1-name
// arg-1
// arg-2
// ...
// probe2-function
// probe2-name
// arg-1
// arg-2
// provider2-name
// ...
// Count the number of strings we'll need
// Provider name
++strcount;
// function + name + one per argument
}
}
// Create place for string offsets
// First we need an empty string: ""
// All probes
const char* t = NULL;
t = string_sig;
t = long_sig;
} else {
t = int_sig;
}
}
}
}
offset += string_index;
// Calculate the size of the rest
// Allocate space for the provider data struction
// Allocate space for all the probes
// Allocate space for the probe offsets
// We need number of arguments argoffs
}
}
if (!dof) {
return -1;
}
// Fill memory with proper values
// all other fields of ident to zero
hdr->dofh_flags = 0;
// First section: STRTAB
sec->dofs_entsize = 0;
// Make data for this section
// Run through all strings again
// All probes
const char* t;
t = string_sig;
t = long_sig;
} else {
t = int_sig;
}
}
}
}
curstr = 1;
// PROVIDER ///////////////////////////////////////////////////////////////
// Section header
sec->dofs_entsize = 0;
// Make provider decriiption
// PROBES /////////////////////////////////////////////////////////////////
// Section header
// Make probes descriptions
// We spent siglen strings here
// Next bunch of offsets
}
// PROFFS /////////////////////////////////////////////////////////////////
// Section header
// Make offsets
}
// PRARGS /////////////////////////////////////////////////////////////////
// Section header
// Make arguments
*par++ = i;
}
}
}
// Register module
}
int fd;
if (handle == -1) {
return;
}
fd = dofhelper_open();
if (fd < 0)
return;
}
if (fd < 0) {
return false;
}
return true;
}
switch (type) {
case 0: return "DOF_SECT_NONE";
case 1: return "DOF_SECT_COMMENTS";
case 2: return "DOF_SECT_SOURCE";
case 3: return "DOF_SECT_ECBDESC";
case 4: return "DOF_SECT_PROBEDESC";
case 5: return "DOF_SECT_ACTDESC";
case 6: return "DOF_SECT_DIFOHDR";
case 7: return "DOF_SECT_DIF";
case 8: return "DOF_SECT_STRTAB";
case 9: return "DOF_SECT_VARTAB";
case 10: return "DOF_SECT_RELTAB";
case 11: return "DOF_SECT_TYPETAB";
case 12: return "DOF_SECT_URELHDR";
case 13: return "DOF_SECT_KRELHDR";
case 14: return "DOF_SECT_OPTDESC";
case 15: return "DOF_SECT_PROVIDER";
case 16: return "DOF_SECT_PROBES";
case 17: return "DOF_SECT_PRARGS";
case 18: return "DOF_SECT_PROFFS";
case 19: return "DOF_SECT_INTTAB";
case 20: return "DOF_SECT_UTSNAME";
case 21: return "DOF_SECT_XLTAB";
case 22: return "DOF_SECT_XLMEMBERS";
case 23: return "DOF_SECT_XLIMPORT";
case 24: return "DOF_SECT_XLEXPORT";
case 25: return "DOF_SECT_PREXPORT";
case 26: return "DOF_SECT_PRENOFFS";
default: return "<unknown>";
}
}
}
}
}
}
}
}
}
}
}
}
}
}
for (int i = 0; i < hdr->dofh_secnum; ++i) {
}
}
}
#else // ndef HAVE_DTRACE_H
// Get here if we're not building on at least Solaris 10
return -1;
}
}
return false;
}
#endif