mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, Robert Richter <rric@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@google.com>,
	Andi Kleen <ak@linux.intel.com>,
	kan.liang@intel.com, adrian.hunter@intel.com,
	markus.t.metzger@intel.com, mathieu.poirier@linaro.org,
	acme@infradead.org
Subject: Re: [PATCH v8 12/14] x86: perf: intel_pt: Intel PT PMU driver
Date: Fri, 9 Jan 2015 15:09:47 +0100	[thread overview]
Message-ID: <20150109140947.GN3337@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1415972627-37514-13-git-send-email-alexander.shishkin@linux.intel.com>

On Fri, Nov 14, 2014 at 03:43:45PM +0200, Alexander Shishkin wrote:
> +static __init int pt_init(void)
> +{
> +	int ret, cpu, prior_warn = 0;
> +
> +	BUILD_BUG_ON(sizeof(struct topa) > PAGE_SIZE);
> +	get_online_cpus();
> +	for_each_online_cpu(cpu) {
> +		u64 ctl;
> +
> +		ret = rdmsrl_safe_on_cpu(cpu, MSR_IA32_RTIT_CTL, &ctl);
> +		if (!ret && (ctl & RTIT_CTL_TRACEEN))
> +			prior_warn++;
> +	}
> +	put_online_cpus();
> +
> +	ret = pt_pmu_hw_init();
> +	if (ret)
> +		return ret;
> +
> +	if (!pt_cap_get(PT_CAP_topa_output)) {
> +		pr_warn("ToPA output is not supported on this CPU\n");
> +		return -ENODEV;
> +	}
> +
> +	if (prior_warn)
> +		pr_warn("PT is enabled at boot time, traces may be empty\n");

Should we not also add_exclusive(pt) here?

Also, if its already enabled, should we not return ENODEV as well, no
saying who or what programmed it, we should not be touching it.

> +	if (!pt_cap_get(PT_CAP_topa_multiple_entries))
> +		pt_pmu.pmu.capabilities =
> +			PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_AUX_SW_DOUBLEBUF;
> +
> +	pt_pmu.pmu.capabilities	|= PERF_PMU_CAP_EXCLUSIVE | PERF_PMU_CAP_ITRACE;
> +	pt_pmu.pmu.attr_groups	= pt_attr_groups;
> +	pt_pmu.pmu.task_ctx_nr	= perf_hw_context;
> +	pt_pmu.pmu.event_init	= pt_event_init;
> +	pt_pmu.pmu.add		= pt_event_add;
> +	pt_pmu.pmu.del		= pt_event_del;
> +	pt_pmu.pmu.start	= pt_event_start;
> +	pt_pmu.pmu.stop		= pt_event_stop;
> +	pt_pmu.pmu.read		= pt_event_read;
> +	pt_pmu.pmu.setup_aux	= pt_buffer_setup_aux;
> +	pt_pmu.pmu.free_aux	= pt_buffer_free_aux;
> +	ret = perf_pmu_register(&pt_pmu.pmu, "intel_pt", -1);
> +
> +	return ret;
> +}

  parent reply	other threads:[~2015-01-09 14:10 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14 13:43 [PATCH v8 00/14] perf: Add infrastructure and support for Intel PT Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 01/14] perf: Add data_{offset,size} to user_page Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 02/14] perf: Add AUX area to ring buffer for raw data streams Alexander Shishkin
2014-11-17  9:33   ` Metzger, Markus T
2015-01-09 15:18     ` Peter Zijlstra
2015-01-12 13:12       ` Alexander Shishkin
2015-01-12 13:38         ` Peter Zijlstra
2015-01-12 14:00           ` Alexander Shishkin
2014-11-17 21:24   ` Sukadev Bhattiprolu
2014-11-17 21:45     ` Andi Kleen
2014-11-14 13:43 ` [PATCH v8 03/14] perf: Support high-order allocations for AUX space Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 04/14] perf: Add a capability for AUX_NO_SG pmus to do software double buffering Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 05/14] perf: Add a pmu capability for "exclusive" events Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 06/14] perf: Add AUX record Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 07/14] perf: Add api for pmus to write to AUX area Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 08/14] perf: Support overwrite mode for " Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 09/14] perf: Add wakeup watermark control to " Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 10/14] x86: Add Intel Processor Trace (INTEL_PT) cpu feature detection Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 11/14] x86: perf: Intel PT and LBR/BTS are mutually exclusive Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 12/14] x86: perf: intel_pt: Intel PT PMU driver Alexander Shishkin
2015-01-09 12:48   ` Peter Zijlstra
2015-01-12 12:19     ` Alexander Shishkin
2015-01-13 15:09     ` Alexander Shishkin
2015-01-13 16:27       ` Peter Zijlstra
2015-01-09 13:10   ` Peter Zijlstra
2015-01-12 12:45     ` Alexander Shishkin
2015-01-09 14:09   ` Peter Zijlstra [this message]
2015-01-12 12:53     ` Alexander Shishkin
2015-01-12 16:37     ` Alexander Shishkin
2015-01-12 16:40       ` Peter Zijlstra
2014-11-14 13:43 ` [PATCH v8 13/14] x86: perf: intel_bts: Add BTS " Alexander Shishkin
2014-11-14 13:43 ` [PATCH v8 14/14] perf: add ITRACE_START record to indicate that tracing has started Alexander Shishkin
2015-01-09 14:12   ` Peter Zijlstra
2015-01-09 14:13     ` Peter Zijlstra
2015-01-12  9:30       ` Adrian Hunter
2014-12-17 14:06 ` [PATCH v8 00/14] perf: Add infrastructure and support for Intel PT Alexander Shishkin
2015-01-07  9:32   ` Alexander Shishkin

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=20150109140947.GN3337@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@infradead.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.t.metzger@intel.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=rric@kernel.org \
    /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

Powered by JetHome