mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
perf tools: Replace %m with %a in sscanf
Not all glibc support %m and it results in a compile error if %m not supported. Replace it with %a and (float *) casts. Signed-off-by: Liming Wang <liming.wang@windriver.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: peterz@infradead.org Cc: mhiramat@redhat.com LKML-Reference: <1259743374-9950-1-git-send-email-liming.wang@windriver.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
1cedae7290
commit
93aaa45a6a
1 changed files with 3 additions and 3 deletions
|
@ -199,8 +199,8 @@ void parse_trace_kprobe_event(const char *str, char **group, char **event,
|
||||||
semantic_error("Too less arguments.");
|
semantic_error("Too less arguments.");
|
||||||
|
|
||||||
/* Scan event and group name. */
|
/* Scan event and group name. */
|
||||||
ret = sscanf(argv[0], "%c:%m[^/ \t]/%m[^ \t]",
|
ret = sscanf(argv[0], "%c:%a[^/ \t]/%a[^ \t]",
|
||||||
&pr, group, event);
|
&pr, (float *)(void *)group, (float *)(void *)event);
|
||||||
if (ret != 3)
|
if (ret != 3)
|
||||||
semantic_error("Failed to parse event name: %s", argv[0]);
|
semantic_error("Failed to parse event name: %s", argv[0]);
|
||||||
pr_debug("Group:%s Event:%s probe:%c\n", *group, *event, pr);
|
pr_debug("Group:%s Event:%s probe:%c\n", *group, *event, pr);
|
||||||
|
@ -211,7 +211,7 @@ void parse_trace_kprobe_event(const char *str, char **group, char **event,
|
||||||
pp->retprobe = (pr == 'r');
|
pp->retprobe = (pr == 'r');
|
||||||
|
|
||||||
/* Scan function name and offset */
|
/* Scan function name and offset */
|
||||||
ret = sscanf(argv[1], "%m[^+]+%d", &pp->function, &pp->offset);
|
ret = sscanf(argv[1], "%a[^+]+%d", (float *)(void *)&pp->function, &pp->offset);
|
||||||
if (ret == 1)
|
if (ret == 1)
|
||||||
pp->offset = 0;
|
pp->offset = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue