]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - tools/lib/symbol/kallsyms.c
1 #include "symbol/kallsyms.h"
5 int kallsyms__parse(const char *filename
, void *arg
,
6 int (*process_symbol
)(void *arg
, const char *name
,
12 FILE *file
= fopen(filename
, "r");
25 line_len
= getline(&line
, &n
, file
);
26 if (line_len
< 0 || !line
)
29 line
[--line_len
] = '\0'; /* \n */
31 len
= hex2u64(line
, &start
);
34 if (len
+ 2 >= line_len
)
37 symbol_type
= line
[len
];
39 symbol_name
= line
+ len
;
42 if (len
>= KSYM_NAME_LEN
) {
47 err
= process_symbol(arg
, symbol_name
, symbol_type
, start
);