Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178065
b: refs/heads/master
c: b7702a2
h: refs/heads/master
i:
  178063: c7b79b9
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Dec 17, 2009
1 parent b85148a commit 2ca71b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f3cf440470650b3841d325acacd0c5ea9504c68
refs/heads/master: b7702a2136b5f8e0e186e22cae91aaecf98b418c
15 changes: 15 additions & 0 deletions trunk/tools/perf/util/probe-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ static int e_snprintf(char *str, size_t size, const char *format, ...)
return ret;
}

/* Check the name is good for event/group */
static bool check_event_name(const char *name)
{
if (!isalpha(*name) && *name != '_')
return false;
while (*++name != '\0') {
if (!isalpha(*name) && !isdigit(*name) && *name != '_')
return false;
}
return true;
}

/* Parse probepoint definition. */
static void parse_perf_probe_probepoint(char *arg, struct probe_point *pp)
{
Expand All @@ -82,6 +94,9 @@ static void parse_perf_probe_probepoint(char *arg, struct probe_point *pp)
ptr = strchr(arg, ':');
if (ptr) /* Group name is not supported yet. */
semantic_error("Group name is not supported yet.");
if (!check_event_name(arg))
semantic_error("%s is bad for event name -it must "
"follow C symbol-naming rule.", arg);
pp->event = strdup(arg);
arg = tmp;
}
Expand Down

0 comments on commit 2ca71b2

Please sign in to comment.