This allows trace analyzers to know whether they should expect the build
id or debug link events following the bin_info event.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
}
tracepoint(lttng_ust_dl, dlopen,
}
tracepoint(lttng_ust_dl, dlopen,
- ip, so_base, resolved_path, memsz);
+ ip, so_base, resolved_path, memsz,
+ has_build_id, has_debug_link);
if (has_build_id) {
tracepoint(lttng_ust_dl, build_id,
if (has_build_id) {
tracepoint(lttng_ust_dl, build_id,
TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
TP_ARGS(void *, ip, void *, baddr, const char*, path,
TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
TP_ARGS(void *, ip, void *, baddr, const char*, path,
+ uint64_t, memsz, uint8_t, has_build_id,
+ uint8_t, has_debug_link),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
ctf_string(path, path)
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
ctf_string(path, path)
+ ctf_integer(uint8_t, has_build_id, has_build_id)
+ ctf_integer(uint8_t, has_debug_link, has_debug_link)
void *, baddr,
const char*, path,
uint64_t, memsz,
void *, baddr,
const char*, path,
uint64_t, memsz,
+ uint8_t, is_pic,
+ uint8_t, has_build_id,
+ uint8_t, has_debug_link
),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
ctf_string(path, path)
ctf_integer(uint8_t, is_pic, is_pic)
),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
ctf_string(path, path)
ctf_integer(uint8_t, is_pic, is_pic)
+ ctf_integer(uint8_t, has_build_id, has_build_id)
+ ctf_integer(uint8_t, has_debug_link, has_debug_link)
int vdso;
uint32_t crc;
uint8_t is_pic;
int vdso;
uint32_t crc;
uint8_t is_pic;
+ uint8_t has_build_id;
+ uint8_t has_debug_link;
};
typedef void (*tracepoint_cb)(struct lttng_session *session, void *priv);
};
typedef void (*tracepoint_cb)(struct lttng_session *session, void *priv);
tracepoint(lttng_ust_statedump, bin_info,
session, bin_data->base_addr_ptr,
tracepoint(lttng_ust_statedump, bin_info,
session, bin_data->base_addr_ptr,
- bin_data->resolved_path, bin_data->memsz, bin_data->is_pic);
+ bin_data->resolved_path, bin_data->memsz,
+ bin_data->is_pic, bin_data->has_build_id,
+ bin_data->has_debug_link);
-int get_elf_info(struct bin_info_data *bin_data, int *has_build_id,
- int *has_debug_link) {
+int get_elf_info(struct bin_info_data *bin_data)
+{
struct lttng_ust_elf *elf;
struct lttng_ust_elf *elf;
elf = lttng_ust_elf_create(bin_data->resolved_path);
if (!elf) {
elf = lttng_ust_elf_create(bin_data->resolved_path);
if (!elf) {
ret = lttng_ust_elf_get_build_id(elf, &bin_data->build_id,
ret = lttng_ust_elf_get_build_id(elf, &bin_data->build_id,
- &bin_data->build_id_len, has_build_id);
+ &bin_data->build_id_len,
+ &found);
+ bin_data->has_build_id = !!found;
+ found = 0;
ret = lttng_ust_elf_get_debug_link(elf, &bin_data->dbg_file,
ret = lttng_ust_elf_get_debug_link(elf, &bin_data->dbg_file,
- &bin_data->crc, has_debug_link);
+ &bin_data->crc,
+ &found);
+ bin_data->has_debug_link = !!found;
bin_data->is_pic = lttng_ust_elf_is_pic(elf);
bin_data->is_pic = lttng_ust_elf_is_pic(elf);
static
int trace_baddr(struct bin_info_data *bin_data)
{
static
int trace_baddr(struct bin_info_data *bin_data)
{
- int ret = 0, has_build_id = 0, has_debug_link = 0;
- ret = get_elf_info(bin_data, &has_build_id, &has_debug_link);
+ ret = get_elf_info(bin_data);
+ if (bin_data->has_build_id) {
ret = trace_statedump_event(
trace_build_id_cb, bin_data->owner, bin_data);
free(bin_data->build_id);
ret = trace_statedump_event(
trace_build_id_cb, bin_data->owner, bin_data);
free(bin_data->build_id);
+ if (bin_data->has_debug_link) {
ret = trace_statedump_event(
trace_debug_link_cb, bin_data->owner, bin_data);
free(bin_data->dbg_file);
ret = trace_statedump_event(
trace_debug_link_cb, bin_data->owner, bin_data);
free(bin_data->dbg_file);