This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC PATCH tracing/kprobes 4/5] perf: Support perf kprobe command for kprobe-event setup helper
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Steven Rostedt <rostedt at goodmis dot org>
- Cc: Frederic Weisbecker <fweisbec at gmail dot com>, Ingo Molnar <mingo at elte dot hu>, lkml <linux-kernel at vger dot kernel dot org>, DLE <dle-develop at lists dot sourceforge dot net>, Thomas Gleixner <tglx at linutronix dot de>, Arnaldo Carvalho de Melo <acme at redhat dot com>, Mike Galbraith <efault at gmx dot de>, Paul Mackerras <paulus at samba dot org>, Peter Zijlstra <a dot p dot zijlstra at chello dot nl>, Christoph Hellwig <hch at infradead dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, "Frank Ch. Eigler" <fche at redhat dot com>, systemtap <systemtap at sourceware dot org>
- Date: Mon, 28 Sep 2009 12:51:48 -0400
- Subject: Re: [RFC PATCH tracing/kprobes 4/5] perf: Support perf kprobe command for kprobe-event setup helper
- References: <20090925191424.12939.91503.stgit@omoto> <20090925191546.12939.75278.stgit@omoto> <1253955120.12145.2.camel@frodo>
Steven Rostedt wrote:
> On Fri, 2009-09-25 at 12:15 -0700, Masami Hiramatsu wrote:
>
>> +
>> +#define MAX_CMDLEN 256
>> +
>> +static int synthesize_probepoint(struct probe_point *pp)
>> +{
>> + char *buf;
>> + int i, len, ret;
>> + pp->probes[0] = buf = (char *)calloc(MAX_CMDLEN, sizeof(char));
>> + len = snprintf(buf, MAX_CMDLEN, "%s+%d", pp->function, pp->offset);
>
> What happens if func and offset is too big for MAX_CMDLEN?
Oops, it must be checked.
>
>> + for (i = 0; i< pp->nr_args; i++) {
>
> Can you have a case where pp->nr_args == 0?
Sure, I'll check that.
Thank you!
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com