GNU Linux-libre 5.19-rc6-gnu
[releases.git] / drivers / staging / media / atomisp / pci / atomisp_trace_event.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support Camera Imaging tracer core.
4  *
5  * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License version
9  * 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  *
17  */
18 #undef TRACE_SYSTEM
19 #define TRACE_SYSTEM atomisp
20
21 #if !defined(ATOMISP_TRACE_EVENT_H) || defined(TRACE_HEADER_MULTI_READ)
22 #define ATOMISP_TRACE_EVENT_H
23
24 #include <linux/tracepoint.h>
25 #include <linux/string.h>
26 TRACE_EVENT(camera_meminfo,
27
28             TP_PROTO(const char *name, int uptr_size, int counter, int sys_size,
29                      int sys_res_size, int cam_sys_use, int cam_dyc_use,
30                      int cam_res_use),
31
32             TP_ARGS(name, uptr_size, counter, sys_size, sys_res_size, cam_sys_use,
33                     cam_dyc_use, cam_res_use),
34
35             TP_STRUCT__entry(
36                 __array(char, name, 24)
37                 __field(int, uptr_size)
38                 __field(int, counter)
39                 __field(int, sys_size)
40                 __field(int, sys_res_size)
41                 __field(int, cam_res_use)
42                 __field(int, cam_dyc_use)
43                 __field(int, cam_sys_use)
44             ),
45
46             TP_fast_assign(
47                 strscpy(__entry->name, name, 24);
48                 __entry->uptr_size = uptr_size;
49                 __entry->counter = counter;
50                 __entry->sys_size = sys_size;
51                 __entry->sys_res_size = sys_res_size;
52                 __entry->cam_res_use = cam_res_use;
53                 __entry->cam_dyc_use = cam_dyc_use;
54                 __entry->cam_sys_use = cam_sys_use;
55             ),
56
57             TP_printk(
58                 "<%s> User ptr memory:%d pages,\tISP private memory used:%d pages:\tsysFP system size:%d,\treserved size:%d\tcamFP sysUse:%d,\tdycUse:%d,\tresUse:%d.\n",
59                 __entry->name, __entry->uptr_size, __entry->counter,
60                 __entry->sys_size, __entry->sys_res_size, __entry->cam_sys_use,
61                 __entry->cam_dyc_use, __entry->cam_res_use)
62            );
63
64 TRACE_EVENT(camera_debug,
65
66             TP_PROTO(const char *name, char *info, const int line),
67
68             TP_ARGS(name, info, line),
69
70             TP_STRUCT__entry(
71                 __array(char, name, 24)
72                 __array(char, info, 24)
73                 __field(int, line)
74             ),
75
76             TP_fast_assign(
77                 strscpy(__entry->name, name, 24);
78                 strscpy(__entry->info, info, 24);
79                 __entry->line = line;
80             ),
81
82             TP_printk("<%s>-<%d> %s\n", __entry->name, __entry->line,
83                       __entry->info)
84            );
85
86 TRACE_EVENT(ipu_cstate,
87
88             TP_PROTO(int cstate),
89
90             TP_ARGS(cstate),
91
92             TP_STRUCT__entry(
93                 __field(int, cstate)
94             ),
95
96             TP_fast_assign(
97                 __entry->cstate = cstate;
98             ),
99
100             TP_printk("cstate=%d", __entry->cstate)
101            );
102
103 TRACE_EVENT(ipu_pstate,
104
105             TP_PROTO(int freq, int util),
106
107             TP_ARGS(freq, util),
108
109             TP_STRUCT__entry(
110                 __field(int, freq)
111                 __field(int, util)
112             ),
113
114             TP_fast_assign(
115                 __entry->freq = freq;
116                 __entry->util = util;
117             ),
118
119             TP_printk("freq=%d util=%d", __entry->freq, __entry->util)
120            );
121 #endif
122
123 #undef TRACE_INCLUDE_PATH
124 #undef TRACE_INCLUDE_FILE
125 #define TRACE_INCLUDE_PATH .
126 #define TRACE_INCLUDE_FILE   atomisp_trace_event
127 /* This part must be outside protection */
128 #include <trace/define_trace.h>