Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1240280
| From | Namhyung Kim <namhyung@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist |
| Date | 2015-10-06 11:10 +0200 |
| Message-ID | <qgwpX-1Fi-9@gated-at.bofh.it> (permalink) |
| References | <qf14R-2jW-3@gated-at.bofh.it> <qf1ey-2v1-17@gated-at.bofh.it> <qfdz4-3iS-17@gated-at.bofh.it> <qgchz-64T-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Adrian,
On Mon, Oct 5, 2015 at 8:29 PM, Adrian Hunter <adrian.hunter@intel.com> wrote:
> On 02/10/15 21:45, Arnaldo Carvalho de Melo wrote:
>> Em Fri, Oct 02, 2015 at 02:18:44PM +0900, Namhyung Kim escreveu:
>>> Since it's gonna share struct mmap with dummy tracking evsel to track
>>> meta events only, let's move auxtrace out of struct perf_mmap.
>> Is this moving around _strictly_ needed?
>
> Also, what if you wanted to capture AUX data and tracking together.
Hmm.. I don't know what's the problem. It should be orthogonal and
support doing that together IMHO. Maybe I'm missing something about
the aux data processing and Intel PT. I'll take a look at it..
>
> In addition, currently Intel PT can have either 1 dummy event for tracking
> plus sched_switch
> or 2 dummy events to allow for system-wide tracking of context switches.
> i.e. there
> are multiple tracking events.
Again, I don't have an idea what's going on this area. I need to look
at the code and think about what I can do.
Thanks for your review!
Namhyung
>
>>
>> - Arnaldo
>>
>>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>>> ---
>>> tools/perf/builtin-record.c | 4 ++--
>>> tools/perf/util/evlist.c | 30 +++++++++++++++++++++---------
>>> tools/perf/util/evlist.h | 2 +-
>>> 3 files changed, 24 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
>>> index 5e01c070dbf2..0accac6e0812 100644
>>> --- a/tools/perf/builtin-record.c
>>> +++ b/tools/perf/builtin-record.c
>>> @@ -220,7 +220,7 @@ static int record__auxtrace_read_snapshot_all(struct record *rec)
>>>
>>> for (i = 0; i < rec->evlist->nr_mmaps; i++) {
>>> struct auxtrace_mmap *mm =
>>> - &rec->evlist->mmap[i].auxtrace_mmap;
>>> + &rec->evlist->auxtrace_mmap[i];
>>>
>>> if (!mm->base)
>>> continue;
>>> @@ -405,7 +405,7 @@ static int record__mmap_read_all(struct record *rec)
>>> int rc = 0;
>>>
>>> for (i = 0; i < rec->evlist->nr_mmaps; i++) {
>>> - struct auxtrace_mmap *mm = &rec->evlist->mmap[i].auxtrace_mmap;
>>> + struct auxtrace_mmap *mm = &rec->evlist->auxtrace_mmap[i];
>>>
>>> if (rec->evlist->mmap[i].base) {
>>> if (record__mmap_read(rec, i) != 0) {
>>> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
>>> index e46adcd5b408..042dffc67986 100644
>>> --- a/tools/perf/util/evlist.c
>>> +++ b/tools/perf/util/evlist.c
>>> @@ -810,9 +810,12 @@ union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx)
>>> return event;
>>> }
>>>
>>> -static bool perf_mmap__empty(struct perf_mmap *md)
>>> +static bool perf_evlist__mmap_empty(struct perf_evlist *evlist, int idx)
>>> {
>>> - return perf_mmap__read_head(md) == md->prev && !md->auxtrace_mmap.base;
>>> + struct perf_mmap *md = &evlist->mmap[idx];
>>> +
>>> + return perf_mmap__read_head(md) == md->prev &&
>>> + evlist->auxtrace_mmap[idx].base == NULL;
>>> }
>>>
>>> static void perf_evlist__mmap_get(struct perf_evlist *evlist, int idx)
>>> @@ -838,7 +841,7 @@ void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx)
>>> perf_mmap__write_tail(md, old);
>>> }
>>>
>>> - if (atomic_read(&md->refcnt) == 1 && perf_mmap__empty(md))
>>> + if (atomic_read(&md->refcnt) == 1 && perf_evlist__mmap_empty(evlist, idx))
>>> perf_evlist__mmap_put(evlist, idx);
>>> }
>>>
>>> @@ -879,7 +882,7 @@ static void __perf_evlist__munmap(struct perf_evlist *evlist, int idx)
>>> evlist->mmap[idx].base = NULL;
>>> atomic_set(&evlist->mmap[idx].refcnt, 0);
>>> }
>>> - auxtrace_mmap__munmap(&evlist->mmap[idx].auxtrace_mmap);
>>> + auxtrace_mmap__munmap(&evlist->auxtrace_mmap[idx]);
>>> }
>>>
>>> void perf_evlist__munmap(struct perf_evlist *evlist)
>>> @@ -901,7 +904,15 @@ static int perf_evlist__alloc_mmap(struct perf_evlist *evlist)
>>> if (cpu_map__empty(evlist->cpus))
>>> evlist->nr_mmaps = thread_map__nr(evlist->threads);
>>> evlist->mmap = zalloc(evlist->nr_mmaps * sizeof(struct perf_mmap));
>>> - return evlist->mmap != NULL ? 0 : -ENOMEM;
>>> + if (evlist->mmap == NULL)
>>> + return -ENOMEM;
>>> + evlist->auxtrace_mmap = calloc(evlist->nr_mmaps,
>>> + sizeof(struct auxtrace_mmap));
>>> + if (evlist->auxtrace_mmap == NULL) {
>>> + zfree(&evlist->mmap);
>>> + return -ENOMEM;
>>> + }
>>> + return 0;
>>> }
>>>
>>> struct mmap_params {
>>> @@ -938,10 +949,6 @@ static int __perf_evlist__mmap(struct perf_evlist *evlist, int idx,
>>> return -1;
>>> }
>>>
>>> - if (auxtrace_mmap__mmap(&evlist->mmap[idx].auxtrace_mmap,
>>> - &mp->auxtrace_mp, evlist->mmap[idx].base, fd))
>>> - return -1;
>>> -
>>> return 0;
>>> }
>>>
>>> @@ -963,6 +970,11 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
>>> *output = fd;
>>> if (__perf_evlist__mmap(evlist, idx, mp, *output) < 0)
>>> return -1;
>>> +
>>> + if (auxtrace_mmap__mmap(&evlist->auxtrace_mmap[idx],
>>> + &mp->auxtrace_mp,
>>> + evlist->mmap[idx].base, fd))
>>> + return -1;
>>> } else {
>>> if (ioctl(fd, PERF_EVENT_IOC_SET_OUTPUT, *output) != 0)
>>> return -1;
>>> diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
>>> index 414e383885f5..51574ce8ac69 100644
>>> --- a/tools/perf/util/evlist.h
>>> +++ b/tools/perf/util/evlist.h
>>> @@ -30,7 +30,6 @@ struct perf_mmap {
>>> int mask;
>>> atomic_t refcnt;
>>> u64 prev;
>>> - struct auxtrace_mmap auxtrace_mmap;
>>> char event_copy[PERF_SAMPLE_MAX_SIZE] __attribute__((aligned(8)));
>>> };
>>>
>>> @@ -53,6 +52,7 @@ struct perf_evlist {
>>> } workload;
>>> struct fdarray pollfd;
>>> struct perf_mmap *mmap;
>>> + struct auxtrace_mmap *auxtrace_mmap;
>>> struct thread_map *threads;
>>> struct cpu_map *cpus;
>>> struct perf_evsel *selected;
>>> --
>>> 2.6.0
>
--
Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC/PATCH 00/38] perf tools: Speed-up perf report by using multi thread (v5) Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 04/38] perf tools: pass perf_mmap desc directly Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
Re: [RFC/PATCH 04/38] perf tools: pass perf_mmap desc directly Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-02 20:50 +0200
[RFC/PATCH 27/38] perf hists: Pass hists struct to hist_entry_iter struct Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 06/38] perf tools: Extend perf_evlist__mmap_ex() to use track mmap Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 18/38] perf tools: Introduce thread__find_addr_location_by_time() and friends Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
Re: [RFC/PATCH 18/38] perf tools: Introduce thread__find_addr_location_by_time() and friends Jiri Olsa <jolsa@redhat.com> - 2015-10-12 15:40 +0200
[RFC/PATCH 21/38] perf tools: Save timestamp of a map creation Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 15/38] perf tools: Introduce machine__find*_thread_by_time() Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
Re: [RFC/PATCH 15/38] perf tools: Introduce machine__find*_thread_by_time() Jiri Olsa <jolsa@redhat.com> - 2015-10-08 14:30 +0200
Re: [RFC/PATCH 15/38] perf tools: Introduce machine__find*_thread_by_time() Namhyung Kim <namhyung@kernel.org> - 2015-10-09 08:10 +0200
[RFC/PATCH 01/38] perf tools: Use a software dummy event to track task/mmap events Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
Re: [RFC/PATCH 01/38] perf tools: Use a software dummy event to track task/mmap events Jiri Olsa <jolsa@redhat.com> - 2015-10-05 15:00 +0200
Re: [RFC/PATCH 01/38] perf tools: Use a software dummy event to track task/mmap events Namhyung Kim <namhyung@kernel.org> - 2015-10-06 10:40 +0200
[RFC/PATCH 28/38] perf tools: Move BUILD_ID_SIZE definition to perf.h Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 13/38] perf tools: Use thread__comm_by_time() when adding hist entries Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 14/38] perf tools: Convert dead thread list into rbtree Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 22/38] perf tools: Introduce map_groups__{insert,find}_by_time() Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 26/38] perf session: Pass struct events stats to event processing functions Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 09/38] perf record: Add --index option for building index table Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
Re: [RFC/PATCH 09/38] perf record: Add --index option for building index table Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-02 21:00 +0200
Re: [RFC/PATCH 09/38] perf record: Add --index option for building index table Jiri Olsa <jolsa@redhat.com> - 2015-10-05 15:50 +0200
Re: [RFC/PATCH 09/38] perf record: Add --index option for building index table Namhyung Kim <namhyung@kernel.org> - 2015-10-07 10:30 +0200
Re: [RFC/PATCH 09/38] perf record: Add --index option for building index table Jiri Olsa <jolsa@redhat.com> - 2015-10-07 14:20 +0200
[RFC/PATCH 23/38] perf tools: Use map_groups__find_addr_by_time() Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 28/38] perf tools: Move BUILD_ID_SIZE definition to perf.h Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 24/38] perf tools: Add testcase for managing maps with time Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 11/38] perf tools: Introduce thread__comm(_str)_by_time() helpers Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
[RFC/PATCH 17/38] perf tools: Maintain map groups list in a leader thread Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:30 +0200
Re: [RFC/PATCH 17/38] perf tools: Maintain map groups list in a leader thread Jiri Olsa <jolsa@redhat.com> - 2015-10-08 15:00 +0200
Re: [RFC/PATCH 17/38] perf tools: Maintain map groups list in a leader thread Namhyung Kim <namhyung@kernel.org> - 2015-10-09 09:10 +0200
Re: [RFC/PATCH 17/38] perf tools: Maintain map groups list in a leader thread Jiri Olsa <jolsa@redhat.com> - 2015-10-12 14:50 +0200
Re: [RFC/PATCH 17/38] perf tools: Maintain map groups list in a leader thread Jiri Olsa <jolsa@redhat.com> - 2015-10-08 15:00 +0200
Re: [RFC/PATCH 17/38] perf tools: Maintain map groups list in a leader thread Namhyung Kim <namhyung@kernel.org> - 2015-10-09 08:30 +0200
[RFC/PATCH 08/38] perf tools: Handle indexed data file properly Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:40 +0200
[RFC/PATCH 02/38] perf tools: Save mmap_param.len instead of mask Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:40 +0200
Re: [RFC/PATCH 02/38] perf tools: Save mmap_param.len instead of mask Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-02 20:50 +0200
Re: [RFC/PATCH 02/38] perf tools: Save mmap_param.len instead of mask Namhyung Kim <namhyung@kernel.org> - 2015-10-06 10:40 +0200
Re: [RFC/PATCH 02/38] perf tools: Save mmap_param.len instead of mask Jiri Olsa <jolsa@redhat.com> - 2015-10-08 12:20 +0200
Re: [RFC/PATCH 02/38] perf tools: Save mmap_param.len instead of mask Namhyung Kim <namhyung@kernel.org> - 2015-10-09 08:10 +0200
Re: [RFC/PATCH 02/38] perf tools: Save mmap_param.len instead of mask Jiri Olsa <jolsa@redhat.com> - 2015-10-12 14:50 +0200
[RFC/PATCH 07/38] perf tools: Add HEADER_DATA_INDEX feature Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:40 +0200
[RFC/PATCH 10/38] perf report: Skip dummy tracking event Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:40 +0200
[RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:40 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-02 20:50 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Adrian Hunter <adrian.hunter@intel.com> - 2015-10-05 13:40 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Namhyung Kim <namhyung@kernel.org> - 2015-10-06 11:10 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Adrian Hunter <adrian.hunter@intel.com> - 2015-10-06 11:30 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Namhyung Kim <namhyung@kernel.org> - 2015-10-07 11:10 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Adrian Hunter <adrian.hunter@intel.com> - 2015-10-08 18:10 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Namhyung Kim <namhyung@kernel.org> - 2015-10-09 10:00 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Namhyung Kim <namhyung@kernel.org> - 2015-10-06 11:00 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Jiri Olsa <jolsa@redhat.com> - 2015-10-05 15:20 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Namhyung Kim <namhyung@kernel.org> - 2015-10-06 10:50 +0200
Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist Jiri Olsa <jolsa@redhat.com> - 2015-10-08 12:20 +0200
[RFC/PATCH 05/38] perf tools: Create separate mmap for dummy tracking event Namhyung Kim <namhyung@kernel.org> - 2015-10-02 07:40 +0200
Re: [RFC/PATCH 28/38] perf tools: Move BUILD_ID_SIZE definition to perf.h Jiri Olsa <jolsa@redhat.com> - 2015-10-12 16:40 +0200
csiph-web