lkml.org 
[lkml]   [2017]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch Monitoring support
    Date


    >-----Original Message-----
    >From: Jiri Olsa [mailto:jolsa@redhat.com]
    >Sent: Saturday, November 4, 2017 6:26 AM
    >To: Megha Dey <megha.dey@linux.intel.com>
    >Cc: x86@kernel.org; linux-kernel@vger.kernel.org; linux-
    >doc@vger.kernel.org; tglx@linutronix.de; mingo@redhat.com;
    >hpa@zytor.com; andriy.shevchenko@linux.intel.com;
    >kstewart@linuxfoundation.org; Yu, Yu-cheng <yu-cheng.yu@intel.com>;
    >Brown, Len <len.brown@intel.com>; gregkh@linuxfoundation.org;
    >peterz@infradead.org; acme@kernel.org;
    >alexander.shishkin@linux.intel.com; namhyung@kernel.org;
    >vikas.shivappa@linux.intel.com; pombredanne@nexb.com;
    >me@kylehuey.com; bp@suse.de; Andrejczuk, Grzegorz
    ><grzegorz.andrejczuk@intel.com>; Luck, Tony <tony.luck@intel.com>;
    >corbet@lwn.net; Shankar, Ravi V <ravi.v.shankar@intel.com>; Dey, Megha
    ><megha.dey@intel.com>
    >Subject: Re: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch
    >Monitoring support
    >
    >On Fri, Nov 03, 2017 at 11:00:05AM -0700, Megha Dey wrote:
    >
    >SNIP
    >
    >> +static unsigned int bm_threshold = BM_MAX_THRESHOLD; static
    >unsigned
    >> +int bm_mispred_evt_cnt;
    >> +
    >> +/* Branch monitoring counter owners */ static struct perf_event
    >> +*bm_counter_owner[2];
    >
    >SNIP
    >
    >> + * Find a hardware counter for the target task
    >> + */
    >> + for (i = 0; i < bm_num_counters; i++) {
    >> + if ((bm_counter_owner[i] == NULL) ||
    >> + (bm_counter_owner[i]->state ==
    >PERF_EVENT_STATE_DEAD)) {
    >> + counter_to_use = i;
    >> + bm_counter_owner[i] = event;
    >> + break;
    >> + }
    >> + }
    >> +
    >> + if (counter_to_use == -1)
    >> + return -EBUSY;
    >
    >not sure I understand, your docs says: "There are 2 8-bit counters that each..
    >"
    >
    >so there are 2 counters per CPU? if that's corrent, isn't this check too strict
    >then? you could have more events configured running on other CPUs for
    >another tasks
    >
    >given that we do task only events here, should bm_counter_owner be part
    >of task, together with the limit..? I'm probably missing something..

    Yes you are right. Initially, we had support for 2 events(from one or 2 tasks) to be monitored for the entire system. This indeed seems very limiting. In the next patchset, I will add support for 2 events per task (This is what the hardware can support).
    >
    >thanks,
    >jirka

    \
     
     \ /
      Last update: 2017-11-11 01:51    [W:2.710 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site