Re: [PATCH v1 4/5] perf: Introduce address range filtering

From: Alexander Shishkin
Date: Mon Apr 25 2016 - 12:14:15 EST


Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:

> On Fri, Apr 22, 2016 at 07:19:11PM +0300, Alexander Shishkin wrote:
>> +/*
>> + * Address range filtering: limiting the data to certain
>> + * instruction address ranges. Filters are ioctl()ed to us from
>> + * userspace as ascii strings.
>> + *
>> + * Filter string format:
>> + *
>> + * ACTION SOURCE:RANGE_SPEC
>> + * where ACTION is one of the
>> + * * "filter": limit the trace to this region
>> + * * "start": start tracing from this address
>> + * * "stop": stop tracing at this address/region;
>> + * SOURCE is either "file" or "kernel"
>> + * RANGE_SPEC is
>> + * * for "kernel": <start address>[/<size>]
>> + * * for "file": <start address>[/<size>]@</path/to/object/file>
>
> SOURCE seems entirely redundant

In the current state, yes, but if we wanted dedicated support for kernel
modules in filter definitions, it may come useful.

>> + *
>> + * if <size> is not specified, the range is treated as a single address.
>
> single instruction, right?

Yes, hitting that instruction will trigger tracing to start. PT doesn't
do this at the moment, but Coresight ETMs/PTMs do.

Regards,
--
Alex