summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorSuril <sdhruv@nvidia.com>2017-06-07 17:31:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-09-15 20:28:01 -0400
commitb790b1583e7aa661497b10e756731d083eed5eac (patch)
tree29832bc7d9229e612ac7e2dc0ea3c5a35b581c63 /include/trace
parent90cb89ffc2b184618cbf34a2a1a9ab378458bca7 (diff)
tracing: Add event tracing mechanism
Add traces for latency measurement to monitor performance. Add events for async_atrace. enable: echo 1 > /sys/kernel/debug/tracing/events/atrace/enable disable: echo 0 > /sys/kernel/debug/tracing/events/atrace/enable AV-388 Change-Id: Id88ab72d1aeab20afc7c0d48dc0fdb905404f5f6 Signed-off-by: Suril Dhruv <sdhruv@nvidia.com> Reviewed-on: http://git-master/r/1497930 Reviewed-on: http://git-master/r/1505062 Reviewed-on: https://git-master.nvidia.com/r/1511675 Reviewed-on: https://git-master.nvidia.com/r/1560227 Reviewed-by: Maneet Maneet Singh <mmaneetsingh@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/atrace.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/include/trace/events/atrace.h b/include/trace/events/atrace.h
new file mode 100644
index 000000000..7fe8b30d9
--- /dev/null
+++ b/include/trace/events/atrace.h
@@ -0,0 +1,111 @@
1/*
2 * include/trace/events/atrace.h
3 *
4 * atrace specific events
5 *
6 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 */
19
20#undef TRACE_SYSTEM
21#define TRACE_SYSTEM atrace
22
23#if !defined(_TRACE_ATRACE_H) || defined(TRACE_HEADER_MULTI_READ)
24#define _TRACE_ATRACE_H
25
26#include <linux/tracepoint.h>
27
28TRACE_EVENT(async_atrace_begin,
29
30 TP_PROTO(const char *trace_str, int trace_id, int tracing_cookie),
31
32 TP_ARGS(trace_str, trace_id, tracing_cookie),
33
34 TP_STRUCT__entry(
35 __field(const char *, trace_str)
36 __field(int, trace_id)
37 __field(int, tracing_cookie)
38 ),
39
40 TP_fast_assign(
41 __entry->trace_str = trace_str;
42 __entry->trace_id = trace_id;
43 __entry->tracing_cookie = tracing_cookie;
44 ),
45
46 TP_printk("tracing_mark_write: S|%d|%s|%d\n", __entry->trace_id,
47 __entry->trace_str, __entry->tracing_cookie)
48);
49
50TRACE_EVENT(async_atrace_end,
51
52 TP_PROTO(const char *trace_str, int trace_id, int tracing_cookie),
53
54 TP_ARGS(trace_str, trace_id, tracing_cookie),
55
56 TP_STRUCT__entry(
57 __field(const char *, trace_str)
58 __field(int, trace_id)
59 __field(int, tracing_cookie)
60 ),
61
62 TP_fast_assign(
63 __entry->trace_str = trace_str;
64 __entry->trace_id = trace_id;
65 __entry->tracing_cookie = tracing_cookie;
66 ),
67
68 TP_printk("tracing_mark_write: F|%d|%s|%d\n", __entry->trace_id,
69 __entry->trace_str, __entry->tracing_cookie)
70);
71
72TRACE_EVENT(atrace_start,
73
74 TP_PROTO(const char *trace_str, int trace_id),
75
76 TP_ARGS(trace_str, trace_id),
77
78 TP_STRUCT__entry(
79 __field(const char *, trace_str)
80 __field(int, trace_id)
81 ),
82
83 TP_fast_assign(
84 __entry->trace_str = trace_str;
85 __entry->trace_id = trace_id;
86 ),
87
88 TP_printk("tracing_mark_write: B|%d|%s\n", __entry->trace_id,
89 __entry->trace_str)
90);
91
92TRACE_EVENT(atrace_end,
93
94 TP_PROTO(const char *trace_str),
95
96 TP_ARGS(trace_str),
97
98 TP_STRUCT__entry(
99 __field(const char *, trace_str)
100 ),
101
102 TP_fast_assign(
103 __entry->trace_str = trace_str;
104 ),
105
106 TP_printk("tracing_mark_write: E|%s\n", __entry->trace_str)
107);
108#endif
109
110/* This part must be outside protection */
111#include <trace/define_trace.h>