From: Steven Rostedt <rostedt@goodmis.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: fweisbec@gmail.com, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org
Subject: Re: [RFC 2/4] perf, ftrace: Add filter support for ftrace:function tracepoint
Date: Wed, 10 Aug 2011 15:34:13 -0400 [thread overview]
Message-ID: <1313004853.18583.263.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1310390576-8289-3-git-send-email-jolsa@redhat.com>
Hi Jiri,
Sorry for the late response, I've been catching up on lots of other
things.
On Mon, 2011-07-11 at 15:22 +0200, Jiri Olsa wrote:
> +int ftrace_function_rec_ip(char *func, unsigned long long *ip)
> +{
> + struct ftrace_page *pg;
> + struct dyn_ftrace *rec;
> + int len = strlen(func);
> + int found = 0;
> +
> + mutex_lock(&ftrace_lock);
> +
> + do_for_each_ftrace_rec(pg, rec) {
> + if (!ftrace_match_record(rec, NULL, func, len, MATCH_FULL))
> + continue;
> +
> + *ip = rec->ip;
> + found = 1;
> + break;
You can't use break here. The do_for_each_ftrace_rec() { }
while_for_each_ftrace_rec(); is a double loop. The break exits the first
loop, but then continues to the next loop. You must use a goto.
-- Steve
> + } while_for_each_ftrace_rec();
> +
> + mutex_unlock(&ftrace_lock);
> +
> + return found ? 0 : -EINVAL;
> +}
> +
next prev parent reply other threads:[~2011-08-10 19:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 13:22 [RFC 0/4] trace,perf: Enabling ftrace:function tracepoint for perf Jiri Olsa
2011-07-11 13:22 ` [RFC 1/4] perf, ftrace: Add perf support to use function tracepoint Jiri Olsa
2011-07-11 13:22 ` [RFC 2/4] perf, ftrace: Add filter support for ftrace:function tracepoint Jiri Olsa
2011-08-10 19:34 ` Steven Rostedt [this message]
2011-07-11 13:22 ` [RFC 3/4] perf, ftrace: Add new perf ioctl for function trace filter Jiri Olsa
2011-07-18 15:12 ` Frederic Weisbecker
2011-07-19 9:57 ` Jiri Olsa
2011-07-26 13:43 ` Frederic Weisbecker
2011-07-27 12:17 ` Jiri Olsa
2011-08-10 20:25 ` Steven Rostedt
2011-07-11 13:22 ` [RFC 4/4] perf, ftrace: Add ftrace option for perf stat command Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313004853.18583.263.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=a.p.zijlstra@chello.nl \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®