• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef _TRACE_TRACE_MARKER_H
17 #define _TRACE_TRACE_MARKER_H
18 
19 #define TRACE_MARKER_MESSAGE_LEN 1024
20 
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25 
26 /**
27   * @brief Write the function call information to the trace_marker node in kernel space,
28   *        used on the same thread as trace_marker_end(),with the symbol "B".
29   * @param message The function of information.
30   * @param value The value which want to trace.
31   */
32 void trace_marker_begin(const char *message, const char *value);
33 
34 /**
35   * @brief Write the terminator to the trace_marker node of the kernel space,
36   *        used on the same thread as trace_marker_begin(),with the symbol "E".
37   */
38 void trace_marker_end(void);
39 
40 /**
41   * @brief Write the function call information to the trace_marker node in kernel space,
42   *        used in a different thread than trace_marker_async_end(),with the symbol "S".
43   * @param message The function of information.
44   * @param value The value which want to trace.
45   */
46 void trace_marker_async_begin(const char *message, const char *value, int taskId);
47 
48 /**
49   * @brief Write the terminator to the trace_marker node in kernel space,
50   *        used in a different thread than trace_marker_async_begin(),with the symbol "F".
51   * @param message The function of information.
52   * @param value The value which want to trace.
53   */
54 void trace_marker_async_end(const char *message, const char *value, int taskId);
55 
56 /**
57   * @brief Marks a pre-traced numeric variable,with the symbol "C".
58   * @param message The function of information.
59   * @param value The value which want to trace.
60   */
61 void trace_marker_count(const char *message, int value);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 #endif
67