This event has no fields.
`lttng_ust_statedump:soinfo`::
- Emitted when information about a currently loaded shared object is
- found.
+ Emitted when information about a currently loaded executable or
+ shared object is found.
+
Fields:
+
[options="header"]
-|==============================================================
+|==================================================================
| Field name | Description
-| `baddr` | Base address of loaded library
-| `memsz` | Size of loaded library in memory
-| `sopath` | Path to loaded library file
-|==============================================================
+| `baddr` | Base address of loaded executable
+| `memsz` | Size of loaded executable in memory
+| `sopath` | Path to loaded executable file
+| `is_pic` | Whether the executable is
+ position-independent code
+|==================================================================
`lttng_ust_statedump:build_id`::
Emitted when a build ID is found in a currently loaded shared
struct lttng_ust_elf *lttng_ust_elf_create(const char *path);
void lttng_ust_elf_destroy(struct lttng_ust_elf *elf);
+uint8_t lttng_ust_elf_is_pic(struct lttng_ust_elf *elf);
int lttng_ust_elf_get_memsz(struct lttng_ust_elf *elf, uint64_t *memsz);
int lttng_ust_elf_get_build_id(struct lttng_ust_elf *elf, uint8_t **build_id,
size_t *length, int *found);
return NULL;
}
+/*
+ * Test whether the ELF file is position independent code (PIC)
+ */
+uint8_t lttng_ust_elf_is_pic(struct lttng_ust_elf *elf)
+{
+ /*
+ * PIC has and e_type value of ET_DYN, see ELF specification
+ * version 1.1 p. 1-3.
+ */
+ return elf->ehdr->e_type == ET_DYN;
+}
+
/*
* Destroy the given lttng_ust_elf instance.
*/
struct lttng_session *, session,
void *, baddr,
const char*, sopath,
- uint64_t, memsz
+ uint64_t, memsz,
+ uint8_t, is_pic
),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
ctf_string(sopath, sopath)
+ ctf_integer(uint8_t, is_pic, is_pic)
)
)
size_t build_id_len;
int vdso;
uint32_t crc;
+ uint8_t is_pic;
};
typedef void (*tracepoint_cb)(struct lttng_session *session, void *priv);
tracepoint(lttng_ust_statedump, soinfo,
session, so_data->base_addr_ptr,
- so_data->resolved_path, so_data->memsz);
+ so_data->resolved_path, so_data->memsz, so_data->is_pic);
}
static
goto end;
}
+ so_data->is_pic = lttng_ust_elf_is_pic(elf);
+
end:
lttng_ust_elf_destroy(elf);
return ret;