diff options
| author | Matt Macy <mmacy@FreeBSD.org> | 2018-05-23 17:25:00 +0000 |
|---|---|---|
| committer | Matt Macy <mmacy@FreeBSD.org> | 2018-05-23 17:25:00 +0000 |
| commit | 0b5dc7f64fcbbcebce577bb267ba4bd861d62251 (patch) | |
| tree | 1f0553274902ce652d135787848d7087fb4103f1 /lib/libpmcstat | |
| parent | 9c4a7c50aeebc645b13007066b018cbc802d688e (diff) | |
Notes
Diffstat (limited to 'lib/libpmcstat')
| -rw-r--r-- | lib/libpmcstat/libpmcstat.h | 2 | ||||
| -rw-r--r-- | lib/libpmcstat/libpmcstat_logging.c | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/libpmcstat/libpmcstat.h b/lib/libpmcstat/libpmcstat.h index ed48acc51330..de657e2215ab 100644 --- a/lib/libpmcstat/libpmcstat.h +++ b/lib/libpmcstat/libpmcstat.h @@ -107,6 +107,7 @@ struct pmcstat_args { #define FLAG_HAS_DURATION 0x00080000 /* -l secs */ #define FLAG_DO_WIDE_GPROF_HC 0x00100000 /* -e */ #define FLAG_SKIP_TOP_FN_RES 0x00200000 /* -I */ +#define FLAG_FILTER_THREAD_ID 0x00400000 /* -L */ int pa_required; /* required features */ int pa_pplugin; /* pre-processing plugin */ @@ -131,6 +132,7 @@ struct pmcstat_args { int pa_topcolor; /* terminal support color */ int pa_mergepmc; /* merge PMC with same name */ double pa_duration; /* time duration */ + uint32_t pa_tid; int pa_argc; char **pa_argv; STAILQ_HEAD(, pmcstat_ev) pa_events; diff --git a/lib/libpmcstat/libpmcstat_logging.c b/lib/libpmcstat/libpmcstat_logging.c index a77a326b9ab5..71ee524bbd8c 100644 --- a/lib/libpmcstat/libpmcstat_logging.c +++ b/lib/libpmcstat/libpmcstat_logging.c @@ -313,6 +313,11 @@ pmcstat_analyze_log(struct pmcstat_args *args, cpuflags = ev.pl_u.pl_cc.pl_cpuflags; cpu = PMC_CALLCHAIN_CPUFLAGS_TO_CPU(cpuflags); + if ((args->pa_flags & FLAG_FILTER_THREAD_ID) && + args->pa_tid != ev.pl_u.pl_cc.pl_tid) { + pmcstat_stats->ps_samples_skipped++; + break; + } /* Filter on the CPU id. */ if (!CPU_ISSET(cpu, &(args->pa_cpumask))) { pmcstat_stats->ps_samples_skipped++; |
