Skip to content

Commit d380eaa

Browse files
author
Ingo Molnar
committed
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
2 parents dda9911 + ef1d1af commit d380eaa

36 files changed

Lines changed: 1647 additions & 1022 deletions

‎tools/perf/Documentation/perf-probe.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ OPTIONS
7373
(Only for --vars) Show external defined variables in addition to local
7474
variables.
7575

76+
-F::
77+
--funcs::
78+
Show available functions in given module or kernel.
79+
7680
-f::
7781
--force::
7882
Forcibly add events with existing name.

‎tools/perf/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ LIB_H += util/debug.h
402402
LIB_H += util/debugfs.h
403403
LIB_H += util/event.h
404404
LIB_H += util/evsel.h
405+
LIB_H += util/evlist.h
405406
LIB_H += util/exec_cmd.h
406407
LIB_H += util/types.h
407408
LIB_H += util/levenshtein.h
@@ -425,6 +426,7 @@ LIB_H += util/values.h
425426
LIB_H += util/sort.h
426427
LIB_H += util/hist.h
427428
LIB_H += util/thread.h
429+
LIB_H += util/thread_map.h
428430
LIB_H += util/trace-event.h
429431
LIB_H += util/probe-finder.h
430432
LIB_H += util/probe-event.h
@@ -440,6 +442,7 @@ LIB_OBJS += $(OUTPUT)util/ctype.o
440442
LIB_OBJS += $(OUTPUT)util/debugfs.o
441443
LIB_OBJS += $(OUTPUT)util/environment.o
442444
LIB_OBJS += $(OUTPUT)util/event.o
445+
LIB_OBJS += $(OUTPUT)util/evlist.o
443446
LIB_OBJS += $(OUTPUT)util/evsel.o
444447
LIB_OBJS += $(OUTPUT)util/exec_cmd.o
445448
LIB_OBJS += $(OUTPUT)util/help.o
@@ -469,6 +472,7 @@ LIB_OBJS += $(OUTPUT)util/map.o
469472
LIB_OBJS += $(OUTPUT)util/pstack.o
470473
LIB_OBJS += $(OUTPUT)util/session.o
471474
LIB_OBJS += $(OUTPUT)util/thread.o
475+
LIB_OBJS += $(OUTPUT)util/thread_map.o
472476
LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
473477
LIB_OBJS += $(OUTPUT)util/trace-event-read.o
474478
LIB_OBJS += $(OUTPUT)util/trace-event-info.o

‎tools/perf/builtin-probe.c‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static struct {
5252
bool show_lines;
5353
bool show_vars;
5454
bool show_ext_vars;
55+
bool show_funcs;
5556
bool mod_events;
5657
int nevents;
5758
struct perf_probe_event events[MAX_PROBES];
@@ -221,6 +222,8 @@ static const struct option options[] = {
221222
OPT__DRY_RUN(&probe_event_dry_run),
222223
OPT_INTEGER('\0', "max-probes", &params.max_probe_points,
223224
"Set how many probe points can be found for a probe."),
225+
OPT_BOOLEAN('F', "funcs", &params.show_funcs,
226+
"Show potential probe-able functions."),
224227
OPT_END()
225228
};
226229

@@ -246,7 +249,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
246249
params.max_probe_points = MAX_PROBES;
247250

248251
if ((!params.nevents && !params.dellist && !params.list_events &&
249-
!params.show_lines))
252+
!params.show_lines && !params.show_funcs))
250253
usage_with_options(probe_usage, options);
251254

252255
/*
@@ -267,12 +270,36 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
267270
pr_err(" Error: Don't use --list with --vars.\n");
268271
usage_with_options(probe_usage, options);
269272
}
273+
if (params.show_funcs) {
274+
pr_err(" Error: Don't use --list with --funcs.\n");
275+
usage_with_options(probe_usage, options);
276+
}
270277
ret = show_perf_probe_events();
271278
if (ret < 0)
272279
pr_err(" Error: Failed to show event list. (%d)\n",
273280
ret);
274281
return ret;
275282
}
283+
if (params.show_funcs) {
284+
if (params.nevents != 0 || params.dellist) {
285+
pr_err(" Error: Don't use --funcs with"
286+
" --add/--del.\n");
287+
usage_with_options(probe_usage, options);
288+
}
289+
if (params.show_lines) {
290+
pr_err(" Error: Don't use --funcs with --line.\n");
291+
usage_with_options(probe_usage, options);
292+
}
293+
if (params.show_vars) {
294+
pr_err(" Error: Don't use --funcs with --vars.\n");
295+
usage_with_options(probe_usage, options);
296+
}
297+
ret = show_available_funcs(params.target_module);
298+
if (ret < 0)
299+
pr_err(" Error: Failed to show functions."
300+
" (%d)\n", ret);
301+
return ret;
302+
}
276303

277304
#ifdef DWARF_SUPPORT
278305
if (params.show_lines) {

0 commit comments

Comments
 (0)