-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrrnotify_stats.c
45 lines (34 loc) · 1.05 KB
/
rrnotify_stats.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* @file rrnotify_stats.c
*
* @remark Copyright (C) 2006-2015 RotateRight, LLC
* @remark Copyright 2002 OProfile authors
* @remark Based on Oprofile's implementation.
* @remark Read the file COPYING
*/
#include "rrnotify.h"
#include <linux/version.h>
#include <linux/smp.h>
#include <linux/cpumask.h>
#include <linux/threads.h>
#include "rrnotify_stats.h"
struct rrnotify_stat_struct rrnotify_stats;
void rrnotify_reset_stats(void)
{
atomic_set(&rrnotify_stats.sample_lost_no_mm, 0);
atomic_set(&rrnotify_stats.event_lost_overflow, 0);
atomic_set(&rrnotify_stats.event_received, 0);
}
void rrnotify_create_stats_files(struct super_block * sb, struct dentry * root)
{
struct dentry * dir;
dir = rrnotifyfs_mkdir(sb, root, "stats");
if (!dir)
return;
rrnotifyfs_create_ro_atomic(sb, dir, "sample_lost_no_mm",
&rrnotify_stats.sample_lost_no_mm);
rrnotifyfs_create_ro_atomic(sb, dir, "event_lost_overflow",
&rrnotify_stats.event_lost_overflow);
rrnotifyfs_create_ro_atomic(sb, dir, "event_received",
&rrnotify_stats.event_received);
}