]>
git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_trace.h
3 * Copyright (C) 2020 NVIDIA Corporation
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #if !defined(_BGP_TRACE_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
24 #include "lib/trace.h"
28 #undef TRACEPOINT_PROVIDER
29 #define TRACEPOINT_PROVIDER frr_bgp
31 #undef TRACEPOINT_INCLUDE
32 #define TRACEPOINT_INCLUDE "bgpd/bgp_trace.h"
34 #include <lttng/tracepoint.h>
36 #include "bgpd/bgpd.h"
37 #include "lib/stream.h"
39 /* clang-format off */
41 TRACEPOINT_EVENT_CLASS(
44 TP_ARGS(struct peer
*, peer
, bgp_size_t
, size
),
46 ctf_string(peer
, peer
->host
? peer
->host
: "(unknown peer)")
50 #define PKT_PROCESS_TRACEPOINT_INSTANCE(name) \
51 TRACEPOINT_EVENT_INSTANCE( \
52 frr_bgp, packet_process, name, \
53 TP_ARGS(struct peer *, peer, bgp_size_t, size)) \
54 TRACEPOINT_LOGLEVEL(frr_bgp, name, TRACE_INFO)
56 PKT_PROCESS_TRACEPOINT_INSTANCE(open_process
)
57 PKT_PROCESS_TRACEPOINT_INSTANCE(keepalive_process
)
58 PKT_PROCESS_TRACEPOINT_INSTANCE(update_process
)
59 PKT_PROCESS_TRACEPOINT_INSTANCE(notification_process
)
60 PKT_PROCESS_TRACEPOINT_INSTANCE(capability_process
)
61 PKT_PROCESS_TRACEPOINT_INSTANCE(refresh_process
)
66 TP_ARGS(struct peer
*, peer
, struct stream
*, pkt
),
68 ctf_string(peer
, peer
->host
? peer
->host
: "(unknown peer)")
69 ctf_sequence_hex(uint8_t, packet
, pkt
->data
, size_t,
74 TRACEPOINT_LOGLEVEL(frr_bgp
, packet_read
, TRACE_INFO
)
79 TP_ARGS(struct peer
*, peer
, char *, pfx
, uint32_t, addpath_id
, afi_t
,
80 afi
, safi_t
, safi
, struct attr
*, attr
),
82 ctf_string(peer
, peer
->host
? peer
->host
: "(unknown peer)")
83 ctf_string(prefix
, pfx
)
84 ctf_integer(uint32_t, addpath_id
, addpath_id
)
85 ctf_integer(afi_t
, afi
, afi
)
86 ctf_integer(safi_t
, safi
, safi
)
87 ctf_integer_hex(intptr_t, attribute_ptr
, attr
)
91 TRACEPOINT_LOGLEVEL(frr_bgp
, process_update
, TRACE_INFO
)
96 TP_ARGS(struct peer
*, peer
, char *, pfx
, afi_t
, afi
, safi_t
, safi
,
97 const char *, result
),
99 ctf_string(peer
, peer
->host
? peer
->host
: "(unknown peer)")
100 ctf_string(prefix
, pfx
)
101 ctf_integer(afi_t
, afi
, afi
)
102 ctf_integer(safi_t
, safi
, safi
)
103 ctf_string(action
, result
)
107 TRACEPOINT_LOGLEVEL(frr_bgp
, input_filter
, TRACE_INFO
)
112 TP_ARGS(struct peer
*, peer
, char *, pfx
, afi_t
, afi
, safi_t
, safi
,
113 const char *, result
),
115 ctf_string(peer
, peer
->host
? peer
->host
: "(unknown peer)")
116 ctf_string(prefix
, pfx
)
117 ctf_integer(afi_t
, afi
, afi
)
118 ctf_integer(safi_t
, safi
, safi
)
119 ctf_string(action
, result
)
123 TRACEPOINT_LOGLEVEL(frr_bgp
, output_filter
, TRACE_INFO
)
125 /* clang-format on */
127 #include <lttng/tracepoint-event.h>
129 #endif /* HAVE_LTTNG */
131 #endif /* _BGP_TRACE_H */