mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@intel.com>
To: Andi Kleen <andi@firstfloor.org>, linux-kernel@vger.kernel.org
Cc: Andi Kleen <ak@linux.intel.com>,
	tom.zanussi@linux.intel.com, rostedt@goodmis.org,
	peterz@infradead.org, alexander.shishkin@linux.intel.com
Subject: Re: [PATCH] Add support for disabling Intel PT trace in ftrace
Date: Wed, 23 Nov 2016 09:41:40 +0200	[thread overview]
Message-ID: <87h96yej7v.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <1479488124-17034-1-git-send-email-andi@firstfloor.org>

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

  parent reply	other threads:[~2016-11-23  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 16:55 Andi Kleen
2016-11-22 22:37 ` Steven Rostedt
2016-11-23  9:49   ` Thomas Gleixner
2016-11-23  7:41 ` Alexander Shishkin [this message]
2016-11-23 16:57   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h96yej7v.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tom.zanussi@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®