|
@@ -1185,17 +1185,21 @@ static void setup_pebs_sample_data(struct perf_event *event,
|
|
|
data->data_src.val = val;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * We must however always use iregs for the unwinder to stay sane; the
|
|
|
+ * record BP,SP,IP can point into thin air when the record is from a
|
|
|
+ * previous PMI context or an (I)RET happend between the record and
|
|
|
+ * PMI.
|
|
|
+ */
|
|
|
+ if (sample_type & PERF_SAMPLE_CALLCHAIN)
|
|
|
+ data->callchain = perf_callchain(event, iregs);
|
|
|
+
|
|
|
/*
|
|
|
* We use the interrupt regs as a base because the PEBS record does not
|
|
|
* contain a full regs set, specifically it seems to lack segment
|
|
|
* descriptors, which get used by things like user_mode().
|
|
|
*
|
|
|
* In the simple case fix up only the IP for PERF_SAMPLE_IP.
|
|
|
- *
|
|
|
- * We must however always use BP,SP from iregs for the unwinder to stay
|
|
|
- * sane; the record BP,SP can point into thin air when the record is
|
|
|
- * from a previous PMI context or an (I)RET happend between the record
|
|
|
- * and PMI.
|
|
|
*/
|
|
|
*regs = *iregs;
|
|
|
|
|
@@ -1214,15 +1218,8 @@ static void setup_pebs_sample_data(struct perf_event *event,
|
|
|
regs->si = pebs->si;
|
|
|
regs->di = pebs->di;
|
|
|
|
|
|
- /*
|
|
|
- * Per the above; only set BP,SP if we don't need callchains.
|
|
|
- *
|
|
|
- * XXX: does this make sense?
|
|
|
- */
|
|
|
- if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) {
|
|
|
- regs->bp = pebs->bp;
|
|
|
- regs->sp = pebs->sp;
|
|
|
- }
|
|
|
+ regs->bp = pebs->bp;
|
|
|
+ regs->sp = pebs->sp;
|
|
|
|
|
|
#ifndef CONFIG_X86_32
|
|
|
regs->r8 = pebs->r8;
|