Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1188693

Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Stephane Eranian <eranian@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver
Date Tue, 21 Jul 2015 08:30:01 +0200
Message-ID <pOzdT-bd-5@gated-at.bofh.it> (permalink)
References <pOsm6-7eJ-19@gated-at.bofh.it> <pOwg1-4pd-1@gated-at.bofh.it> <pOyUx-8gm-9@gated-at.bofh.it>
X-Original-To Andy Lutomirski <luto@amacapital.net>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GOhimKT0a77fmWB/mYcFM5HJrlJHwKSQF9mw0hx7tXU=; b=Bb4M/KAVj9CwY3lnqYyVCFyaa36L5JZzMkdjKxPa3k2EhkUZTMhKiyXo5VW240xXgq D9Hf7VM7rjjueco6IrvM16A3Y7RunyWSl0N0aimfkVtmmsHbR+IxEHeDP+Tp3e147yup BnmQqrsTrkNTxrth3Kl7sDnHJMrN4rk9FDFIAgYLC2na+pjfM8iqFhNtNk8WZmPpgPOy BxAkAb3hDz9FQVLeUOYH7wLuzXnqOcnDkvxV5oWEvUqQgRBvDDo5v3U87fqGDvlpADyR JbLTNNDl/HCyijhd3pMh+vHP5IuVXa4Eu42ahf8PjstEyDpc+Vnw/FtuWWr5suo3UW3v IFYQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=GOhimKT0a77fmWB/mYcFM5HJrlJHwKSQF9mw0hx7tXU=; b=S7yuL5k5/fGnfYaS1wyA7OOxlD6BM65e+xjHI2GtI0o6vQDR4H6LXvLfaBSJ2C5g5F Ym+g9HEyd4/2QMePiYfWN6BgX3w8wcsQOPqqSXJfIbP2x+NXJONMhqj6YDGWHVanH0YF np+K3Wc69J2Txcty0necqHL9W4pUsRIZ8G4QKiaWufwP5WUgl1l4fGpDW0P133RrTsw6 uIZ/TehedXPYITRwCxQSMQ1kn2PaMw8uF2BPPB3nFbDwDg1JE783ujn6/hSoBh9HA+s9 I/nFa2DYs6AR+vAEPD2ec0Am/07M4GMmzLtLrjXL1EXiWsR+lHWLLjJCs1s6wPzOso5R 0F9g==
X-Gm-Message-State ALoCoQlQHCZ04v31HFG2mzPK++gh6TJ0Uyl9IRUcrj/Q29aCT0u0emE30QT2jMWQB/is55M76ajl
MIME-Version 1.0
X-Received by 10.180.83.101 with SMTP id p5mr28672927wiy.52.1437459719133; Mon, 20 Jul 2015 23:21:59 -0700 (PDT)
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 39
Organization linux.* mail to news gateway
X-Original-Cc Kan Liang <kan.liang@intel.com>, Peter Zijlstra <a.p.zijlstra@chello.nl>, "mingo@redhat.com" <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, "ak@linux.intel.com" <ak@linux.intel.com>, Mark Rutland <mark.rutland@arm.com>, Adrian Hunter <adrian.hunter@intel.com>, David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, LKML <linux-kernel@vger.kernel.org>, Andy Lutomirski <luto@kernel.org>
X-Original-Date Mon, 20 Jul 2015 23:21:59 -0700
X-Original-Message-ID <CABPqkBRevqeP-yLtS=WB9i3rE9qByaYRXzZxgSM3QMoR5JmiRA@mail.gmail.com>
X-Original-References <1437407346-31186-1-git-send-email-kan.liang@intel.com> <CABPqkBS8pBGyGmjd0uhDm0-hshVwZ_WdigB2+6qTEtCFv3Ugiw@mail.gmail.com> <CALCETrWR8hGQehwnnjq8=n9hk6S5uSe9UaRu-iKHXpz+emMWbw@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1188693

Show key headers only | View raw


On Mon, Jul 20, 2015 at 11:01 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Mon, Jul 20, 2015 at 8:10 PM, Stephane Eranian <eranian@google.com> wrote:
>> On Mon, Jul 20, 2015 at 8:49 AM, Kan Liang <kan.liang@intel.com> wrote:
>>> From: Andy Lutomirski <luto@kernel.org>
>>>
>>> This patch adds freq PMU to support time and freq related counters
>>> includes TSC, IA32_APERF, IA32_MPERF and IA32_PPERF.
>>>
>>> The events are exposed in sysfs for use by perf stat and other tools.
>>> The files are under /sys/devices/freq/events/
>>>
>>> These events only support system-wide mode counting.
>>>
>>> The PMU type (attr->type) is PERF_TYPE_FREQ.
>>>
>>> Example:
>>>
>>> To caculate the CPU%
>>> CPU_Utilization = CPU_CLK_UNHALTED.REF_TSC / TSC
>>>
>>> $ perf stat -e '{ref-cycles,freq/tsc/}' -C0 -- taskset -c 0 sleep 1
>>> 3164023,,ref-cycles,1048387386,100.00
>>> 2410812089,,freq/tsc/,1050022373,100.00
>>> The CPU% for sleep is 0.13%.
>>>
>> This event is system-wide only. Thus, the kernel should return
>> an error when you try to use it in per-thread mode. That would
>> be more consistent with RAPL and uncore events.
>
> I don't know enough about perf's inner workings to be sure, but can't
> perf context switch free-running counters like this?
>
It should be able to but your patch does not seem to do this. I get zero
count when I try.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver Andy Lutomirski <luto@amacapital.net> - 2015-07-21 08:10 +0200
  Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver Stephane Eranian <eranian@google.com> - 2015-07-21 08:30 +0200
    Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver Andy Lutomirski <luto@amacapital.net> - 2015-07-21 08:30 +0200

csiph-web