blob: d27990610f9f4bfff8598bd71855f4b1f14f1a8c [file] [log] [blame]
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -02001#ifndef PERF_BUILD_ID_H_
2#define PERF_BUILD_ID_H_ 1
3
Masami Hiramatsud77fac72015-07-15 18:14:28 +09004#define BUILD_ID_SIZE 20
5#define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1)
Jiri Olsa4383db82012-10-27 23:18:29 +02006
7#include "tool.h"
Masami Hiramatsu8d8c8e42015-02-27 13:50:26 +09008#include "strlist.h"
Borislav Petkovd944c4e2014-04-25 21:31:02 +02009#include <linux/types.h>
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -020010
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020011extern struct perf_tool build_id__mark_dso_hit_ops;
Jiri Olsa4383db82012-10-27 23:18:29 +020012struct dso;
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -020013
Jiri Olsaebb296c2012-10-27 23:18:28 +020014int build_id__sprintf(const u8 *build_id, int len, char *bf);
Masami Hiramatsu0b5a7932015-08-15 20:42:59 +090015int sysfs__sprintf_build_id(const char *root_dir, char *sbuild_id);
16int filename__sprintf_build_id(const char *pathname, char *sbuild_id);
Masami Hiramatsu01412262016-05-29 00:15:37 +090017char *build_id_cache__kallsyms_path(const char *sbuild_id, char *bf,
18 size_t size);
Masami Hiramatsu0b5a7932015-08-15 20:42:59 +090019
Arnaldo Carvalho de Melo33449962013-12-10 15:46:29 -030020char *dso__build_id_filename(const struct dso *dso, char *bf, size_t size);
Wang Nane7ee4042016-02-05 14:01:27 +000021bool dso__build_id_is_kmod(const struct dso *dso, char *bf, size_t size);
Arnaldo Carvalho de Melob36f19d2010-05-20 12:15:33 -030022
Andrew Vagin54a3cf52012-08-07 16:56:05 +040023int build_id__mark_dso_hit(struct perf_tool *tool, union perf_event *event,
24 struct perf_sample *sample, struct perf_evsel *evsel,
25 struct machine *machine);
Namhyung Kime195fac2014-11-04 10:14:30 +090026
27int dsos__hit_all(struct perf_session *session);
28
29bool perf_session__read_build_ids(struct perf_session *session, bool with_hits);
30int perf_session__write_buildid_table(struct perf_session *session, int fd);
31int perf_session__cache_build_ids(struct perf_session *session);
32
Masami Hiramatsu1f3736c2016-07-01 17:03:26 +090033char *build_id_cache__origname(const char *sbuild_id);
34char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size);
Masami Hiramatsu4698b8b2016-06-08 18:29:30 +090035char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
36 bool is_kallsyms, bool is_vdso);
Masami Hiramatsuc3492a32016-07-12 19:04:54 +090037struct strlist *build_id_cache__list_all(bool validonly);
Masami Hiramatsua5981802016-07-12 19:05:37 +090038char *build_id_cache__complement(const char *incomplete_sbuild_id);
Masami Hiramatsu8d8c8e42015-02-27 13:50:26 +090039int build_id_cache__list_build_ids(const char *pathname,
40 struct strlist **result);
Masami Hiramatsua50d11a2015-02-26 15:54:40 +090041bool build_id_cache__cached(const char *sbuild_id);
Masami Hiramatsue35f7362015-02-10 18:18:51 +090042int build_id_cache__add_s(const char *sbuild_id,
Namhyung Kime195fac2014-11-04 10:14:30 +090043 const char *name, bool is_kallsyms, bool is_vdso);
Masami Hiramatsue35f7362015-02-10 18:18:51 +090044int build_id_cache__remove_s(const char *sbuild_id);
Namhyung Kim73c5d222014-11-07 22:57:56 +090045void disable_buildid_cache(void);
Namhyung Kime195fac2014-11-04 10:14:30 +090046
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -020047#endif