test: perf: prevent overflow counter from stopping counter

Fixes: 1a204b6 "perf: overflow test"
Change-Id: I4d8e93b97f7a8d58ef7811f55b5c995b16c5af69
This commit is contained in:
Masamichi Takagi
2020-03-27 02:12:04 -04:00
parent d086100b35
commit c3c0b7197f
3 changed files with 32 additions and 2 deletions

View File

@@ -164,9 +164,12 @@ static void build_perf_event_ioc_reset(struct command *cmd)
}
// perf_event_ioc_refresh command
static int perf_event_ioc_refresh(int fd, void *_args)
int perf_event_ioc_refresh(int fd, void *_args)
{
int ret = asm_ioctl3(fd, PERF_EVENT_IOC_REFRESH, 0);
/* Prevent overflow counter from stopping counter
* Note that it starts counter as well
*/
int ret = asm_ioctl3(fd, PERF_EVENT_IOC_REFRESH, 256);
if (ret < 0) {
errno = -ret;