Skip to content

Commit

Permalink
Revert "perf record: Fix crash in pipe mode"
Browse files Browse the repository at this point in the history
This reverts commit f766148 which is
commit ad46e48 upstream.

It breaks the build.  Turns out we don't test perf on stable releases,
we need to fix that :(

Reported-by: Pavlos Parissis <pavlos.parissis@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
gregkh committed May 30, 2018
1 parent ec39812 commit 48aaff1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
9 changes: 0 additions & 9 deletions tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
}
}

/*
* If we have just single event and are sending data
* through pipe, we need to force the ids allocation,
* because we synthesize event name through the pipe
* and need the id for that.
*/
if (data->is_pipe && rec->evlist->nr_entries == 1)
rec->opts.sample_id = true;

if (record__open(rec) != 0) {
err = -1;
goto out_child;
Expand Down
1 change: 0 additions & 1 deletion tools/perf/perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ struct record_opts {
bool tail_synthesize;
bool overwrite;
bool ignore_missing_thread;
bool sample_id;
unsigned int freq;
unsigned int mmap_pages;
unsigned int auxtrace_mmap_pages;
Expand Down
8 changes: 2 additions & 6 deletions tools/perf/util/record.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
struct perf_evsel *evsel;
bool use_sample_identifier = false;
bool use_comm_exec;
bool sample_id = opts->sample_id;

/*
* Set the evsel leader links before we configure attributes,
Expand All @@ -164,7 +163,8 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
* match the id.
*/
use_sample_identifier = perf_can_sample_identifier();
sample_id = true;
evlist__for_each_entry(evlist, evsel)
perf_evsel__set_sample_id(evsel, use_sample_identifier);
} else if (evlist->nr_entries > 1) {
struct perf_evsel *first = perf_evlist__first(evlist);

Expand All @@ -174,10 +174,6 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
use_sample_identifier = perf_can_sample_identifier();
break;
}
sample_id = true;
}

if (sample_id) {
evlist__for_each_entry(evlist, evsel)
perf_evsel__set_sample_id(evsel, use_sample_identifier);
}
Expand Down

0 comments on commit 48aaff1

Please sign in to comment.