lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAN_5kQB+BjPc5Sj=a-4B80-6t5D3C4WkvP6bz_BRcMd6LKAzqw@mail.gmail.com>
Date:	Sun, 12 Feb 2012 12:37:30 -0600
From:	heechul Yun <heechul@...inois.edu>
To:	linux-kernel@...r.kernel.org
Cc:	Vince Weaver <vweaver1@...s.utk.edu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Question about resetting a sampling counter in kernel

Hello,

I have a question about controlling performance counter in kernel.

I created a kernel counter which generates an interrupt at every
10000 cache-misses as shown below.

struct perf_event_attr sched_perf_hw_attr = {
     .type = PERF_TYPE_HARDWARE,
     .config = PERF_COUNT_HW_CACHE_MISSES,
     .sample_period = 10000,
     .size = sizeof(struct perf_event_attr),
     .pinned = 1,
     .disbled = 1,
}

event = perf_event_create_kernel_counter(&sched_perf_hw_attr, cpu,
       NULL, event_overflow_callback, NULL);

What I would like to do is to "reset" the counter before the
overflow interrupt occurs (e.g, reset at 5000th event),
and then to restart the sampling from 0.

I found perf_event_enable() and perf_event_disable() only
start/stop the counting but couln't figure out how to reset the
sampling as I described above.

I would be really thankful if you explain how I can efficiently reset the
sampling counter.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ