u8                              sample_branch;
        u8                              sample_remote_access;
        u8                              sample_memory;
+       u8                              sample_instructions;
+       u64                             instructions_sample_period;
 
        u64                             l1d_miss_id;
        u64                             l1d_access_id;
        u64                             branch_miss_id;
        u64                             remote_access_id;
        u64                             memory_id;
+       u64                             instructions_id;
 
        u64                             kernel_start;
 
        u64                             time;
        u64                             timestamp;
        struct thread                   *thread;
+       u64                             period_instructions;
 };
 
 static void arm_spe_dump(struct arm_spe *spe __maybe_unused,
        speq->pid = -1;
        speq->tid = -1;
        speq->cpu = -1;
+       speq->period_instructions = 0;
 
        /* params set */
        params.get_trace = arm_spe_get_trace;
        return arm_spe_deliver_synth_event(spe, speq, event, &sample);
 }
 
+static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
+                                            u64 spe_events_id, u64 data_src)
+{
+       struct arm_spe *spe = speq->spe;
+       struct arm_spe_record *record = &speq->decoder->record;
+       union perf_event *event = speq->event_buf;
+       struct perf_sample sample = { .ip = 0, };
+
+       /*
+        * Handles perf instruction sampling period.
+        */
+       speq->period_instructions++;
+       if (speq->period_instructions < spe->instructions_sample_period)
+               return 0;
+       speq->period_instructions = 0;
+
+       arm_spe_prep_sample(spe, speq, event, &sample);
+
+       sample.id = spe_events_id;
+       sample.stream_id = spe_events_id;
+       sample.addr = record->virt_addr;
+       sample.phys_addr = record->phys_addr;
+       sample.data_src = data_src;
+       sample.period = spe->instructions_sample_period;
+       sample.weight = record->latency;
+
+       return arm_spe_deliver_synth_event(spe, speq, event, &sample);
+}
+
 #define SPE_MEM_TYPE   (ARM_SPE_L1D_ACCESS | ARM_SPE_L1D_MISS | \
                         ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS | \
                         ARM_SPE_REMOTE_ACCESS)
                        return err;
        }
 
+       if (spe->sample_instructions) {
+               err = arm_spe__synth_instruction_sample(speq, spe->instructions_id, data_src);
+               if (err)
+                       return err;
+       }
+
        return 0;
 }
 
                        return err;
                spe->memory_id = id;
                arm_spe_set_event_name(evlist, id, "memory");
+               id += 1;
+       }
+
+       if (spe->synth_opts.instructions) {
+               if (spe->synth_opts.period_type != PERF_ITRACE_PERIOD_INSTRUCTIONS) {
+                       pr_warning("Only instruction-based sampling period is currently supported by Arm SPE.\n");
+                       goto synth_instructions_out;
+               }
+               if (spe->synth_opts.period > 1)
+                       pr_warning("Arm SPE has a hardware-based sample period.\n"
+                                  "Additional instruction events will be discarded by --itrace\n");
+
+               spe->sample_instructions = true;
+               attr.config = PERF_COUNT_HW_INSTRUCTIONS;
+               attr.sample_period = spe->synth_opts.period;
+               spe->instructions_sample_period = attr.sample_period;
+               err = arm_spe_synth_event(session, &attr, id);
+               if (err)
+                       return err;
+               spe->instructions_id = id;
+               arm_spe_set_event_name(evlist, id, "instructions");
        }
+synth_instructions_out:
 
        return 0;
 }