2 * drivers/misc/tegra-profiler/hrt.h
4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
22 #include <linux/hrtimer.h>
23 #include <linux/limits.h>
25 #include "backtrace.h"
27 struct quadd_thread_data {
32 struct quadd_cpu_context {
33 struct hrtimer hrtimer;
35 struct quadd_callchain cc;
36 char mmap_filename[PATH_MAX];
38 struct quadd_thread_data active_thread;
42 struct quadd_hrt_ctx {
43 struct quadd_cpu_context * __percpu cpu_ctx;
46 struct quadd_ctx *quadd_ctx;
49 atomic64_t counter_samples;
50 atomic_t nr_active_all_core;
52 struct timer_list ma_timer;
53 unsigned int ma_period;
55 unsigned long vm_size_prev;
56 unsigned long rss_size_prev;
59 #define QUADD_HRT_MIN_FREQ 100
61 #define QUADD_U32_MAX (~(__u32)0)
64 struct quadd_record_data;
65 struct quadd_module_state;
68 struct quadd_hrt_ctx *quadd_hrt_init(struct quadd_ctx *ctx);
69 void quadd_hrt_deinit(void);
71 int quadd_hrt_start(void);
72 void quadd_hrt_stop(void);
74 void quadd_put_sample(struct quadd_record_data *data,
75 struct quadd_iovec *vec, int vec_count);
77 void quadd_hrt_get_state(struct quadd_module_state *state);
78 u64 quadd_get_time(void);
80 #endif /* __KERNEL__ */
82 #endif /* __QUADD_HRT_H */