File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -162,9 +162,17 @@ static bool is_child_pid(pid_t parent, pid_t child)
162
162
163
163
static bool should_ignore_sample (const struct perf_sample * sample , const struct tpebs_retire_lat * t )
164
164
{
165
- pid_t workload_pid = t -> evsel -> evlist -> workload .pid ;
166
- pid_t sample_pid = sample -> pid ;
165
+ pid_t workload_pid , sample_pid = sample -> pid ;
167
166
167
+ /*
168
+ * During evlist__purge the evlist will be removed prior to the
169
+ * evsel__exit calling evsel__tpebs_close and taking the
170
+ * tpebs_mtx. Avoid a segfault by ignoring samples in this case.
171
+ */
172
+ if (t -> evsel -> evlist == NULL )
173
+ return true;
174
+
175
+ workload_pid = t -> evsel -> evlist -> workload .pid ;
168
176
if (workload_pid < 0 || workload_pid == sample_pid )
169
177
return false;
170
178
You can’t perform that action at this time.
0 commit comments