Hi All,

I am trying to query the performance management counters on my box, which is 
based on Kernel 2.6.38 and running Intel processor.  I am trying to do the 
same from my kernel module itself as I need to profile my kernel modules. I 
use the perf_event_create_kernel_counter() api with the following attr/config

The below  attrs/configuration is working and I am getting the counter 
values/overflow_handler is getting called.
static struct perf_event_attr counter_attrs[] = {
{
        {
         .type           = PERF_TYPE_HARDWARE,
         .config                = PERF_COUNT_HW_CACHE_MISSES,
         .size           = sizeof(struct perf_event_attr),
         .pinned         = 1,
         .disabled       = 0,
         },
 };

But, when I use the following attrs/config, the 
perf_event_create_kernel_counter() API is failing.  Ie,  (IS_ERR
(returned_pevent) is TRUE and the event is not triggered on the CPU.  I even 
used “PERF_TYPE_HARDWARE” type also with the below config.
static struct perf_event_attr counter_attrs[] = {
{
        .type             =  PERF_TYPE_HW_CACHE,
 .config          =      PERF_COUNT_HW_CACHE_L1D                           <<  
0  |
                        (PERF_COUNT_HW_CACHE_OP_READ               <<  8) |
                        (PERF_COUNT_HW_CACHE_RESULT_MISS           << 16),
        .size     = sizeof(struct perf_event_attr),
        .pinned   = 1,
        .disabled = 0,
        },
 };

Does anybody know why?. What “config” value  I should use to query the L1D/ 
L1I cache misses. I think the “PERF_COUNT_HW_CACHE_MISSES” counts only 2nd and 
3rd level caches.

Thanks,
Suja


--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to