Re: perf/ftrace: does PERF_EVENT_IOC_SET_FILTER serve any purpose?

From: Vince Weaver
Date: Tue Jun 09 2015 - 16:12:37 EST


On Tue, 9 Jun 2015, David Ahern wrote:

> On 6/9/15 2:02 PM, Vince Weaver wrote:
> > # ls/sys/kernel/debug/tracing/events/irq/irq_handler_entry/
> > enable filter format id trigger
> >
> > # perf list
> > ....
> > [ Tracepoints not available: No such file or directory ]
> >
> > strace shows
> > statfs("/sys/kernel/debug/tracing/events", {f_type=0x74726163,
> > f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0,
> > f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
> >
> > so I have no idea what's going wrong here.
>
> Check Steven's email; probably the issue.
>
> >
> >
> > Anyway, on a related question, I see for the event that you use
> > --filter irq==28
> > How do I find out the valid filters for each event? Do I have to parse
> > the "format" file under
> > /sys/kernel/debug/tracing/events/*/* ?
>
> Yes. And *very important* don't use the print fmt names, but the field names.
> Often they are the same but when they differ it can be maddening.

OK, thanks, this was very helpful, combined with figuring out the perf
issue, I finally have some code that is successfully using the ioctl.

The ftrace documentation says you can clear a filter by writing "0" to it,
but that doesn't seem to work with the ioctl.

Is there better documentation for the filters than the ftrace.txt file
that comes with the kernel?

Vince
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/