diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-19 12:48:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-19 12:48:42 -0500 |
commit | eca9dfcd0029c8a84b1094bb84a2fb53e4addf6c (patch) | |
tree | 2e5982fef1e737ce5f8936981c7dc7fb50fc655c /tools/perf/util/probe-event.c | |
parent | 3981e152864fcc1dbbb564e1f4c0ae11a09639d2 (diff) | |
parent | b5b60fda1e462a849bc37dfbace2888191be82cc (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf session: Make events_stats u64 to avoid overflow on 32-bit arches
hw-breakpoints: Fix hardware breakpoints -> perf events dependency
perf events: Dont report side-band events on each cpu for per-task-per-cpu events
perf events, x86/stacktrace: Fix performance/softlockup by providing a special frame pointer-only stack walker
perf events, x86/stacktrace: Make stack walking optional
perf events: Remove unused perf_counter.h header file
perf probe: Check new event name
kprobe-tracer: Check new event/group name
perf probe: Check whether debugfs path is correct
perf probe: Fix libdwarf include path for Debian
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r-- | tools/perf/util/probe-event.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 2ca62154f79b..29465d440043 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -62,6 +62,18 @@ static int e_snprintf(char *str, size_t size, const char *format, ...) | |||
62 | return ret; | 62 | return ret; |
63 | } | 63 | } |
64 | 64 | ||
65 | /* Check the name is good for event/group */ | ||
66 | static bool check_event_name(const char *name) | ||
67 | { | ||
68 | if (!isalpha(*name) && *name != '_') | ||
69 | return false; | ||
70 | while (*++name != '\0') { | ||
71 | if (!isalpha(*name) && !isdigit(*name) && *name != '_') | ||
72 | return false; | ||
73 | } | ||
74 | return true; | ||
75 | } | ||
76 | |||
65 | /* Parse probepoint definition. */ | 77 | /* Parse probepoint definition. */ |
66 | static void parse_perf_probe_probepoint(char *arg, struct probe_point *pp) | 78 | static void parse_perf_probe_probepoint(char *arg, struct probe_point *pp) |
67 | { | 79 | { |
@@ -82,6 +94,9 @@ static void parse_perf_probe_probepoint(char *arg, struct probe_point *pp) | |||
82 | ptr = strchr(arg, ':'); | 94 | ptr = strchr(arg, ':'); |
83 | if (ptr) /* Group name is not supported yet. */ | 95 | if (ptr) /* Group name is not supported yet. */ |
84 | semantic_error("Group name is not supported yet."); | 96 | semantic_error("Group name is not supported yet."); |
97 | if (!check_event_name(arg)) | ||
98 | semantic_error("%s is bad for event name -it must " | ||
99 | "follow C symbol-naming rule.", arg); | ||
85 | pp->event = strdup(arg); | 100 | pp->event = strdup(arg); |
86 | arg = tmp; | 101 | arg = tmp; |
87 | } | 102 | } |