rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* |
| 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 |
| 25 | extern int met_timer_expire; /* in jiffies */ |
| 26 | extern 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 | |
| 37 | int met_hrtimer_start(void); |
| 38 | void met_hrtimer_stop(void); |
| 39 | int sampler_start(void); |
| 40 | void sampler_stop(void); |
| 41 | |
| 42 | extern struct list_head met_list; |
| 43 | extern void add_cookie(struct pt_regs *regs, int cpu); |
| 44 | extern int met_hrtimer_suspend(void); |
| 45 | extern void met_hrtimer_resume(void); |
| 46 | extern void met_event_timer_notify(void); |
| 47 | |
| 48 | #ifdef CONFIG_CPU_FREQ |
| 49 | #include "power.h" |
| 50 | #endif |
| 51 | |
| 52 | #endif /* _SAMPLER_H_ */ |