Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PERF_LIBBFD_H
3#define __PERF_LIBBFD_H
4
5#include <linux/compiler.h>
6#include <linux/types.h>
7#include <stdbool.h>
8#include <stddef.h>
9
10struct annotate_args;
11struct build_id;
12struct dso;
13struct inline_node;
14struct symbol;
15
16#ifdef HAVE_LIBBFD_SUPPORT
17int libbfd__addr2line(const char *dso_name, u64 addr,
18 char **file, unsigned int *line, struct dso *dso,
19 bool unwind_inlines, struct inline_node *node,
20 struct symbol *sym);
21
22
23void dso__free_a2l_libbfd(struct dso *dso);
24
25int symbol__disassemble_libbfd(const char *filename, struct symbol *sym,
26 struct annotate_args *args);
27
28int libbfd__read_build_id(const char *filename, struct build_id *bid);
29
30int libbfd_filename__read_debuglink(const char *filename, char *debuglink, size_t size);
31
32int symbol__disassemble_bpf_libbfd(struct symbol *sym, struct annotate_args *args);
33
34#else // !defined(HAVE_LIBBFD_SUPPORT)
35#include "annotate.h"
36
37static inline int libbfd__addr2line(const char *dso_name __always_unused,
38 u64 addr __always_unused,
39 char **file __always_unused,
40 unsigned int *line __always_unused,
41 struct dso *dso __always_unused,
42 bool unwind_inlines __always_unused,
43 struct inline_node *node __always_unused,
44 struct symbol *sym __always_unused)
45{
46 return -1;
47}
48
49
50static inline void dso__free_a2l_libbfd(struct dso *dso __always_unused)
51{
52}
53
54static inline int symbol__disassemble_libbfd(const char *filename __always_unused,
55 struct symbol *sym __always_unused,
56 struct annotate_args *args __always_unused)
57{
58 return -1;
59}
60
61static inline int libbfd__read_build_id(const char *filename __always_unused,
62 struct build_id *bid __always_unused)
63{
64 return -1;
65}
66
67static inline int libbfd_filename__read_debuglink(const char *filename __always_unused,
68 char *debuglink __always_unused,
69 size_t size __always_unused)
70{
71 return -1;
72}
73
74static inline int symbol__disassemble_bpf_libbfd(struct symbol *sym __always_unused,
75 struct annotate_args *args __always_unused)
76{
77 return SYMBOL_ANNOTATE_ERRNO__NO_LIBOPCODES_FOR_BPF;
78}
79
80#endif // defined(HAVE_LIBBFD_SUPPORT)
81
82#endif /* __PERF_LIBBFD_H */