Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1239570
| From | Jiri Olsa <jolsa@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC/PATCH 09/38] perf record: Add --index option for building index table |
| Date | 2015-10-05 15:50 +0200 |
| Message-ID | <qgejn-uJ-3@gated-at.bofh.it> (permalink) |
| References | <qf14R-2jW-3@gated-at.bofh.it> <qf14T-2jW-49@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Oct 02, 2015 at 02:18:50PM +0900, Namhyung Kim wrote:
SNIP
> +static int record__merge_index_files(struct record *rec, int nr_index)
> +{
> + int i;
> + int ret = -ENOMEM;
> + u64 offset;
> + char path[PATH_MAX];
> + struct perf_file_section *idx;
> + struct perf_data_file *file = &rec->file;
> + struct perf_session *session = rec->session;
> + int output_fd = perf_data_file__fd(file);
> +
> + /* +1 for header file itself */
> + nr_index++;
> +
> + idx = calloc(nr_index, sizeof(*idx));
> + if (idx == NULL)
> + goto out_close;
> +
> + offset = lseek(output_fd, 0, SEEK_END);
> +
> + idx[0].offset = session->header.data_offset;
> + idx[0].size = offset - idx[0].offset;
> +
> + for (i = 1; i < nr_index; i++) {
> + struct stat stbuf;
> + int fd = rec->fds[i - 1];
> +
> + ret = fstat(fd, &stbuf);
> + if (ret < 0)
> + goto out_close;
> +
> + idx[i].offset = offset;
> + idx[i].size = stbuf.st_size;
> +
> + offset += stbuf.st_size;
> +
> + if (idx[i].size == 0)
> + continue;
> +
> + ret = copyfile_offset(fd, 0, output_fd, idx[i].offset,
> + idx[i].size);
> + if (ret < 0)
> + goto out_close;
> + }
> +
> + session->header.index = idx;
> + session->header.nr_index = nr_index;
> +
> + perf_has_index = true;
I might have asked earlier, but why is this global? seems like
perf_session member to me..
thanks,
jirka
--
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