blob: 6089c2d986eaedf79af6737aa951ec6f74da4251 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
2 * Copyright (C) 2018 MediaTek Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _SAMPLER_H_
15#define _SAMPLER_H_
16
17/*
18 * sampling rate: 1ms
19 * log generating rate: 10ms
20 */
21#if 0
22#define DEFAULT_TIMER_EXPIRE (HZ / 100)
23#define DEFAULT_HRTIMER_EXPIRE (TICK_NSEC / 10)
24#else
25extern int met_timer_expire; /* in jiffies */
26extern int met_hrtimer_expire; /* in us */
27#define DEFAULT_TIMER_EXPIRE (met_timer_expire)
28#define DEFAULT_HRTIMER_EXPIRE (met_hrtimer_expire)
29#endif
30/*
31 * sampling rate: 10ms
32 * log generating rate: 100ms
33 */
34/* #define DEFAULT_TIMER_EXPIRE (HZ / 10) */
35/* #define DEFAULT_HRTIMER_EXPIRE (TICK_NSEC / 1) */
36
37int met_hrtimer_start(void);
38void met_hrtimer_stop(void);
39int sampler_start(void);
40void sampler_stop(void);
41
42extern struct list_head met_list;
43extern void add_cookie(struct pt_regs *regs, int cpu);
44extern int met_hrtimer_suspend(void);
45extern void met_hrtimer_resume(void);
46extern void met_event_timer_notify(void);
47
48#ifdef CONFIG_CPU_FREQ
49#include "power.h"
50#endif
51
52#endif /* _SAMPLER_H_ */