1414#include "util/session.h"
1515#include "util/tool.h"
1616#include "util/debug.h"
17+ #include "util/build-id.h"
1718
1819#include "util/parse-options.h"
1920
@@ -116,6 +117,8 @@ static int perf_event__repipe_sample(struct perf_tool *tool,
116117 return f (tool , event , sample , evsel , machine );
117118 }
118119
120+ build_id__mark_dso_hit (tool , event , sample , evsel , machine );
121+
119122 return perf_event__repipe_synth (tool , event , machine );
120123}
121124
@@ -310,6 +313,7 @@ static int perf_inject__sched_stat(struct perf_tool *tool,
310313 sample_sw .time = sample -> time ;
311314 perf_event__synthesize_sample (event_sw , evsel -> attr .sample_type ,
312315 & sample_sw , false);
316+ build_id__mark_dso_hit (tool , event_sw , & sample_sw , evsel , machine );
313317 return perf_event__repipe (tool , event_sw , & sample_sw , machine );
314318}
315319
@@ -342,8 +346,7 @@ static int __cmd_inject(struct perf_inject *inject)
342346
343347 signal (SIGINT , sig_handler );
344348
345- if (inject -> build_ids ) {
346- inject -> tool .sample = perf_event__inject_buildid ;
349+ if (inject -> build_ids || inject -> sched_stat ) {
347350 inject -> tool .mmap = perf_event__repipe_mmap ;
348351 inject -> tool .fork = perf_event__repipe_fork ;
349352 inject -> tool .tracing_data = perf_event__repipe_tracing_data ;
@@ -353,7 +356,9 @@ static int __cmd_inject(struct perf_inject *inject)
353356 if (session == NULL )
354357 return - ENOMEM ;
355358
356- if (inject -> sched_stat ) {
359+ if (inject -> build_ids ) {
360+ inject -> tool .sample = perf_event__inject_buildid ;
361+ } else if (inject -> sched_stat ) {
357362 struct perf_evsel * evsel ;
358363
359364 inject -> tool .ordered_samples = true;
0 commit comments