Skip to content

Commit 48aaff1

Browse files
committed
Revert "perf record: Fix crash in pipe mode"
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>
1 parent ec39812 commit 48aaff1

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

‎tools/perf/builtin-record.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -926,15 +926,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
926926
}
927927
}
928928

929-
/*
930-
* If we have just single event and are sending data
931-
* through pipe, we need to force the ids allocation,
932-
* because we synthesize event name through the pipe
933-
* and need the id for that.
934-
*/
935-
if (data->is_pipe && rec->evlist->nr_entries == 1)
936-
rec->opts.sample_id = true;
937-
938929
if (record__open(rec) != 0) {
939930
err = -1;
940931
goto out_child;

‎tools/perf/perf.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct record_opts {
6161
bool tail_synthesize;
6262
bool overwrite;
6363
bool ignore_missing_thread;
64-
bool sample_id;
6564
unsigned int freq;
6665
unsigned int mmap_pages;
6766
unsigned int auxtrace_mmap_pages;

‎tools/perf/util/record.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
137137
struct perf_evsel *evsel;
138138
bool use_sample_identifier = false;
139139
bool use_comm_exec;
140-
bool sample_id = opts->sample_id;
141140

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

@@ -174,10 +174,6 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
174174
use_sample_identifier = perf_can_sample_identifier();
175175
break;
176176
}
177-
sample_id = true;
178-
}
179-
180-
if (sample_id) {
181177
evlist__for_each_entry(evlist, evsel)
182178
perf_evsel__set_sample_id(evsel, use_sample_identifier);
183179
}

0 commit comments

Comments
 (0)