summaryrefslogtreecommitdiff
path: root/usr/src/cmd/latencytop/common/dwrapper.c
diff options
context:
space:
mode:
authorKrishnendu Sadhukhan - Sun Microsystems <Krishnendu.Sadhukhan@Sun.COM>2010-02-26 21:09:12 -0800
committerKrishnendu Sadhukhan - Sun Microsystems <Krishnendu.Sadhukhan@Sun.COM>2010-02-26 21:09:12 -0800
commita9c12afde877c596eed286ac3f1d518246e5cd1e (patch)
treee29a7bbc2efecc597117e476429e67a50c668aa5 /usr/src/cmd/latencytop/common/dwrapper.c
parent87974390c959ee024ced157c12358eda9533afbe (diff)
downloadillumos-joyent-a9c12afde877c596eed286ac3f1d518246e5cd1e.tar.gz
6888464 Add a command-line option to track only a given process in LatencyTOP
Contributed by Lejun Zhu <lejun.zhu@intel.com>
Diffstat (limited to 'usr/src/cmd/latencytop/common/dwrapper.c')
-rw-r--r--usr/src/cmd/latencytop/common/dwrapper.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/usr/src/cmd/latencytop/common/dwrapper.c b/usr/src/cmd/latencytop/common/dwrapper.c
index f634065e38..851c581af7 100644
--- a/usr/src/cmd/latencytop/common/dwrapper.c
+++ b/usr/src/cmd/latencytop/common/dwrapper.c
@@ -402,6 +402,7 @@ lt_dtrace_init(void)
dtrace_proginfo_t info;
int err;
FILE *fp_script = NULL;
+ char tmp[64];
pid_self = getpid();
@@ -439,7 +440,27 @@ lt_dtrace_init(void)
if ((err = dtrace_setopt(g_dtp, "define",
"ENABLE_SCHED")) != 0) {
lt_display_error(
- "Failed to set option ENABLE_SYNCOBJ.\n");
+ "Failed to set option ENABLE_SCHED.\n");
+ return (err);
+ }
+ }
+
+ if (g_config.lt_cfg_trace_pid != 0) {
+ (void) snprintf(tmp, sizeof (tmp), "TRACE_PID=%u",
+ g_config.lt_cfg_trace_pid);
+ if ((err = dtrace_setopt(g_dtp, "define", tmp)) != 0) {
+ lt_display_error(
+ "Failed to set option TRACE_PID.\n");
+ return (err);
+ }
+ }
+
+ if (g_config.lt_cfg_trace_pgid != 0) {
+ (void) snprintf(tmp, sizeof (tmp), "TRACE_PGID=%u",
+ g_config.lt_cfg_trace_pgid);
+ if ((err = dtrace_setopt(g_dtp, "define", tmp)) != 0) {
+ lt_display_error(
+ "Failed to set option TRACE_PGID.\n");
return (err);
}
}
@@ -448,7 +469,7 @@ lt_dtrace_init(void)
if ((err = dtrace_setopt(g_dtp, "define",
"ENABLE_LOW_OVERHEAD")) != 0) {
lt_display_error(
- "Failed to set option ENABLE_SYNCOBJ.\n");
+ "Failed to set option ENABLE_LOW_OVERHEAD.\n");
return (err);
}
}