File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -387,26 +387,16 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
387
387
return arm_spe_deliver_synth_event (spe , speq , event , & sample );
388
388
}
389
389
390
- #define SPE_MEM_TYPE (ARM_SPE_L1D_ACCESS | ARM_SPE_L1D_MISS | \
391
- ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS | \
392
- ARM_SPE_REMOTE_ACCESS)
393
-
394
- static bool arm_spe__is_memory_event (enum arm_spe_sample_type type )
395
- {
396
- if (type & SPE_MEM_TYPE )
397
- return true;
398
-
399
- return false;
400
- }
401
-
402
390
static u64 arm_spe__synth_data_source (const struct arm_spe_record * record )
403
391
{
404
392
union perf_mem_data_src data_src = { 0 };
405
393
406
394
if (record -> op == ARM_SPE_LD )
407
395
data_src .mem_op = PERF_MEM_OP_LOAD ;
408
- else
396
+ else if ( record -> op == ARM_SPE_ST )
409
397
data_src .mem_op = PERF_MEM_OP_STORE ;
398
+ else
399
+ return 0 ;
410
400
411
401
if (record -> type & (ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS )) {
412
402
data_src .mem_lvl = PERF_MEM_LVL_L3 ;
@@ -510,7 +500,11 @@ static int arm_spe_sample(struct arm_spe_queue *speq)
510
500
return err ;
511
501
}
512
502
513
- if (spe -> sample_memory && arm_spe__is_memory_event (record -> type )) {
503
+ /*
504
+ * When data_src is zero it means the record is not a memory operation,
505
+ * skip to synthesize memory sample for this case.
506
+ */
507
+ if (spe -> sample_memory && data_src ) {
514
508
err = arm_spe__synth_mem_sample (speq , spe -> memory_id , data_src );
515
509
if (err )
516
510
return err ;
You can’t perform that action at this time.
0 commit comments