Skip to content

Commit

Permalink
perf: Fix perf probe build error
Browse files Browse the repository at this point in the history
When we run into dry run mode, we want to make
write_kprobe_trace_event to succeed on writing the event. Let's
initialize it to 0.

Fixes the following build error:
	util/probe-event.c:1266: attention : «ret» may be used uninitialized in this function
	util/probe-event.c:1266: note: «ret» was declared here

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <1271808065-25290-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Apr 21, 2010
1 parent dcf46b9 commit 6eca8cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/probe-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ static struct strlist *get_kprobe_trace_event_names(int fd, bool include_group)

static int write_kprobe_trace_event(int fd, struct kprobe_trace_event *tev)
{
int ret;
int ret = 0;
char *buf = synthesize_kprobe_trace_command(tev);

if (!buf) {
Expand Down

0 comments on commit 6eca8cc

Please sign in to comment.