Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1528162
| From | Alexander Shishkin <alexander.shishkin@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Add support for disabling Intel PT trace in ftrace |
| Date | 2016-11-23 08:50 +0100 |
| Message-ID | <sGAtA-1VC-5@gated-at.bofh.it> (permalink) |
| References | <sEUG6-1ff-37@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Andi Kleen <andi@firstfloor.org> writes:
> +/*
> + * Disable the PT trace for debugging purposes.
> + */
> +void pt_disable(void)
> +{
> + u64 val;
> +
> + if (!boot_cpu_has(X86_FEATURE_INTEL_PT))
> + return;
> +
> + rdmsrl_safe(MSR_IA32_RTIT_CTL, &val);
> + val &= ~RTIT_CTL_TRACEEN;
> + wrmsrl_safe(MSR_IA32_RTIT_CTL, val);
> +}
> +EXPORT_SYMBOL(pt_disable);
This will create unexplainable gaps in the trace, at least we should
output RECORD_AUX when this happens, maybe add a flag for "had to stop
the trace for reasons external to perf".
Also, I can't tell if this is called from an atomic context.
But I'd suggest something more generic like perf_pmu_off($pmu):
- we already have the code to stop the output;
- this won't be a driver-specific api then;
- this will be reflected in the event hw state;
- it will also go through the driver's callbacks, so its internal
states will actually match the reality;
- will work equally well for intel_bts or the ARM/Coresight tracers.
Regards,
--
Alex
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] Add support for disabling Intel PT trace in ftrace Andi Kleen <andi@firstfloor.org> - 2016-11-18 18:00 +0100
Re: [PATCH] Add support for disabling Intel PT trace in ftrace Steven Rostedt <rostedt@goodmis.org> - 2016-11-22 23:40 +0100
Re: [PATCH] Add support for disabling Intel PT trace in ftrace Thomas Gleixner <tglx@linutronix.de> - 2016-11-23 11:30 +0100
Re: [PATCH] Add support for disabling Intel PT trace in ftrace Alexander Shishkin <alexander.shishkin@intel.com> - 2016-11-23 08:50 +0100
Re: [PATCH] Add support for disabling Intel PT trace in ftrace Andi Kleen <andi@firstfloor.org> - 2016-11-23 18:00 +0100
csiph-web