// NB: when adding new options, consider very carefully whether they
// should be restricted from stap clients (after --client-options)!
-#define STAP_SHORT_OPTIONS "hVvtp:I:e:o:R:r:a:m:kgPc:x:D:bs:uqwl:d:L:FS:B:WG:"
+#define STAP_SHORT_OPTIONS "hVvtp:I:e:o:R:r:a:m:kgPc:x:D:bs:uqwl:d:L:FS:B:J:WG:"
#define OWE5 "tter"
#define OWE1 "uild-"
# $6 - method
# $7 - number of args
# $8 - entry/exit/line
+# $9 - options to pass to bminstall
#We need to both record, and check that this pid is the first
#This is to avoid recurssion in probing java processes
then
touch $4/java/$JAVA_FILE
touch $4/java/`hostname`-install
- exec bminstall.sh $2 &
+ exec bminstall.sh $5 $2 &
pid=$!
wait $pid
rm $4/java/`hostname`-install 2>&1 1>/dev/null
install)
if [[ ! -f "$4/java/$JAVA_FILE" && ! -f "$4/java/`hostname`-install" ]]
then
- install_byteman $1 $2 $3 $4
+ install_byteman $1 $2 $3 $4 $5
fi
submit_byteman $1 $2 $3 $4
;;
mkdir -p $2/java
check_running $2 $3 $5 $6
write_rule $1 $2 $3 $4 $5 $6 $7 $8
-run_byteman $1 $3 $4 $2
+run_byteman $1 $3 $4 $2 $9
update_release_sysroot = false;
suppress_time_limits = false;
+#ifdef HAVE_JAVA_HELPER
+ compile_byteman_rule = false;
+#endif /* HAVE_JAVA_HELPER */
+
// PR12443: put compiled-in / -I paths in front, to be preferred during
// tapset duplicate-file elimination
const char* s_p = getenv ("SYSTEMTAP_TAPSET");
c_macros = other.c_macros;
args = other.args;
kbuildflags = other.kbuildflags;
+
+#ifdef HAVE_JAVA_HELPER
+ compile_byteman_rule = other.compile_byteman_rule;
+ bminstallflags = other.bminstallflags;
+#endif /* HAVE_JAVA_HELPER */
+
globalopts = other.globalopts;
modinfos = other.modinfos;
#ifdef HAVE_LIBSQLITE3
" -q generate information on tapset coverage\n"
#endif /* HAVE_LIBSQLITE3 */
+#ifdef HAVE_JAVA_HELPER
+ " -J request byteman pass such options to the JVM during bminstall\n"
+#endif /* HAVE_JAVA_HELPER */
" --runtime=MODE\n"
" set the pass-5 runtime mode, instead of kernel\n"
#ifdef HAVE_DYNINST
kbuildflags.push_back (string (optarg));
break;
+ case 'J':
+#ifdef HAVE_JAVA_HELPER
+ bminstallflags.push_back(string("-D") + (string (optarg)) );
+ break;
+#else
+ cerr << _("You may only specify -J options when configured with --with-jdk") << endl;
+ return 1;
+#endif /* HAVE_JAVA_HELPER */
+
case LONG_OPT_VERSION:
version ();
throw exit_exception (EXIT_SUCCESS);
int download_dbinfo;
bool suppress_handler_errors;
bool suppress_time_limits;
+#ifdef HAVE_JAVA_HELPER
+ bool compile_byteman_rule;
+ std::vector<std::string> bminstallflags; // -J var=val
+#endif
enum { kernel_runtime, dyninst_runtime } runtime_mode;
bool runtime_usermode_p() const { return runtime_mode == dyninst_runtime; }
$6 - method
$7 - number of args
$8 - entry/exit/line
+ $9 - options to pass to bminstall
*/
char arg_count[3];
stapbm_string.append("exit");
else if(!has_return && has_line_number)
stapbm_string.append(method_line_val);
+ if(!sess.bminstallflags.empty())
+ {
+ stapbm_string.append(" ");
+ for (vector<string>::iterator it = sess.bminstallflags.begin() ; it != sess.bminstallflags.end(); ++it)
+ stapbm_string.append(*it + " ");
+ }
+
block *bb = new block;
bb->tok = base->body->tok;
functioncall *fc = new functioncall;