Motr  M0
trace_internal.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_LIB_TRACE_INTERNAL_H__
26 #define __MOTR_LIB_TRACE_INTERNAL_H__
27 
28 #include "lib/trace.h" /* m0_trace_buf_header */
29 
30 
31 struct m0_trace_area {
33  char ta_buf[0];
34 };
35 
36 M0_INTERNAL int m0_arch_trace_init(void);
37 
38 M0_INTERNAL void m0_arch_trace_fini(void);
39 
40 M0_INTERNAL int
41 m0_trace_subsys_list_to_mask(char *subsys_names, unsigned long *ret_mask);
42 
43 M0_INTERNAL enum m0_trace_level m0_trace_level_parse(char *str);
44 
45 M0_INTERNAL enum m0_trace_print_context
46 m0_trace_print_context_parse(const char *ctx_name);
47 
48 M0_INTERNAL const char *m0_trace_level_name(enum m0_trace_level level);
49 
50 M0_INTERNAL const char *m0_trace_subsys_name(uint64_t subsys);
51 
53  uint8_t v8;
54  uint16_t v16;
55  uint32_t v32;
56  uint64_t v64;
57 };
58 
60 
61 M0_INTERNAL int m0_trace_args_unpack(const struct m0_trace_rec_header *trh,
63  const void *buf);
64 
65 M0_INTERNAL const struct m0_trace_buf_header *m0_trace_logbuf_header_get(void);
66 M0_INTERNAL const void *m0_trace_logbuf_get(void);
67 M0_INTERNAL uint32_t m0_trace_logbuf_size_get(void);
68 M0_INTERNAL void m0_trace_logbuf_size_set(size_t size);
69 M0_INTERNAL uint64_t m0_trace_logbuf_pos_get(void);
70 M0_INTERNAL const void *m0_trace_magic_sym_addr_get(void);
71 M0_INTERNAL const char *m0_trace_magic_sym_name_get(void);
73 
74 M0_INTERNAL const struct m0_trace_rec_header *m0_trace_last_record_get(void);
75 
76 M0_INTERNAL const char *m0_trace_file_path_get(void);
77 
78 M0_INTERNAL void m0_trace_stats_update(uint32_t rec_size);
79 
80 M0_INTERNAL void m0_trace_buf_header_init(struct m0_trace_buf_header *tbh, size_t buf_size);
81 M0_INTERNAL void m0_arch_trace_buf_header_init(struct m0_trace_buf_header *tbh);
82 
83 M0_INTERNAL void m0_trace_switch_to_static_logbuf(void);
84 
85 M0_INTERNAL void m0_console_vprintf(const char *fmt, va_list ap);
86 
87 #endif /* __MOTR_LIB_TRACE_INTERNAL_H__ */
88 
89 /*
90  * Local variables:
91  * c-indentation-style: "K&R"
92  * c-basic-offset: 8
93  * tab-width: 8
94  * fill-column: 80
95  * scroll-step: 1
96  * End:
97  */
M0_INTERNAL void m0_trace_buf_header_init(struct m0_trace_buf_header *tbh, size_t buf_size)
Definition: trace.c:956
M0_INTERNAL const void * m0_trace_logbuf_get(void)
Definition: trace.c:618
M0_INTERNAL uint32_t m0_trace_logbuf_size_get(void)
Definition: trace.c:624
M0_INTERNAL void m0_trace_logbuf_size_set(size_t size)
Definition: trace.c:630
enum m0_trace_level level
Definition: trace.c:111
M0_INTERNAL const char * m0_trace_file_path_get(void)
Definition: ktrace.c:72
int m0_trace_magic_sym_extra_addr_add(const void *addr)
Definition: trace.c:654
union m0_trace_rec_argument m0_trace_rec_args_t[M0_TRACE_ARGC_MAX]
M0_INTERNAL const struct m0_trace_rec_header * m0_trace_last_record_get(void)
Definition: trace.c:929
M0_INTERNAL void m0_console_vprintf(const char *fmt, va_list ap)
Definition: ktrace.c:160
Definition: ub.c:49
M0_INTERNAL const char * m0_trace_magic_sym_name_get(void)
Definition: trace.c:649
struct m0_trace_buf_header ta_header
Definition: sock.c:887
M0_INTERNAL void m0_arch_trace_fini(void)
Definition: ktrace.c:225
M0_INTERNAL const char * m0_trace_subsys_name(uint64_t subsys)
Definition: trace.c:339
M0_INTERNAL int m0_trace_subsys_list_to_mask(char *subsys_names, unsigned long *ret_mask)
Definition: trace.c:414
M0_INTERNAL void m0_trace_switch_to_static_logbuf(void)
Definition: trace.c:986
M0_INTERNAL void m0_trace_stats_update(uint32_t rec_size)
Definition: ktrace.c:119
M0_INTERNAL const char * m0_trace_level_name(enum m0_trace_level level)
Definition: trace.c:460
char * fmt(const char *format,...) __attribute__((format(printf
Definition: xcode.h:73
M0_INTERNAL const struct m0_trace_buf_header * m0_trace_logbuf_header_get(void)
Definition: trace.c:612
M0_INTERNAL int m0_trace_args_unpack(const struct m0_trace_rec_header *trh, m0_trace_rec_args_t args, const void *buf)
Definition: trace.c:690
m0_trace_level
Definition: trace.h:454
m0_bcount_t size
Definition: di.c:39
m0_trace_print_context
Definition: trace.h:496
static uint32_t buf_size
Definition: ad.c:75
M0_INTERNAL const void * m0_trace_magic_sym_addr_get(void)
Definition: trace.c:644
M0_INTERNAL int m0_arch_trace_init(void)
Definition: ktrace.c:178
M0_INTERNAL void m0_arch_trace_buf_header_init(struct m0_trace_buf_header *tbh)
Definition: ktrace.c:233
M0_INTERNAL enum m0_trace_print_context m0_trace_print_context_parse(const char *ctx_name)
Definition: trace.c:548
M0_INTERNAL uint64_t m0_trace_logbuf_pos_get(void)
Definition: trace.c:638
M0_INTERNAL enum m0_trace_level m0_trace_level_parse(char *str)
Definition: trace.c:521