summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ad6ec39)
The current names of the `lttng_ust_statedump:soinfo` event, as well
as its field `sopath` both refer exclusively to shared objects (so),
although the event applies to any executables, including
position-independent executables (PIE), as well as shared objects.
Thus, this patch changes the name of the event to `bin_info` and the
field to `path`, to avoid any confusion.
For consistency, the `sopath` field in the `lttng_ust_dl:dlopen` event
is also renamed to `path`, although dlopen only applies to shared
objects.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#include <lttng/tracepoint.h>
TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
#include <lttng/tracepoint.h>
TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
- TP_ARGS(void *, ip, void *, baddr, const char*, sopath,
+ TP_ARGS(void *, ip, void *, baddr, const char*, path,
uint64_t, memsz),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
uint64_t, memsz),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, memsz)
- ctf_string(sopath, sopath)
-TRACEPOINT_EVENT(lttng_ust_statedump, soinfo,
+TRACEPOINT_EVENT(lttng_ust_statedump, bin_info,
TP_ARGS(
struct lttng_session *, session,
void *, baddr,
TP_ARGS(
struct lttng_session *, session,
void *, baddr,
uint64_t, memsz,
uint8_t, is_pic
),
TP_FIELDS(
ctf_integer_hex(void *, baddr, baddr)
ctf_integer(uint64_t, memsz, 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)
)
)
ctf_integer(uint8_t, is_pic, is_pic)
)
)
void *owner;
void *base_addr_ptr;
const char *resolved_path;
void *owner;
void *base_addr_ptr;
const char *resolved_path;
-void trace_soinfo_cb(struct lttng_session *session, void *priv)
+void trace_bin_info_cb(struct lttng_session *session, void *priv)
- struct soinfo_data *so_data = (struct soinfo_data *) priv;
+ struct bin_info_data *bin_data = (struct bin_info_data *) priv;
- tracepoint(lttng_ust_statedump, soinfo,
- session, so_data->base_addr_ptr,
- so_data->resolved_path, so_data->memsz, so_data->is_pic);
+ tracepoint(lttng_ust_statedump, bin_info,
+ session, bin_data->base_addr_ptr,
+ bin_data->resolved_path, bin_data->memsz, bin_data->is_pic);
}
static
void trace_build_id_cb(struct lttng_session *session, void *priv)
{
}
static
void trace_build_id_cb(struct lttng_session *session, void *priv)
{
- struct soinfo_data *so_data = (struct soinfo_data *) priv;
+ struct bin_info_data *bin_data = (struct bin_info_data *) priv;
tracepoint(lttng_ust_statedump, build_id,
tracepoint(lttng_ust_statedump, build_id,
- session, so_data->base_addr_ptr,
- so_data->build_id, so_data->build_id_len);
+ session, bin_data->base_addr_ptr,
+ bin_data->build_id, bin_data->build_id_len);
}
static
void trace_debug_link_cb(struct lttng_session *session, void *priv)
{
}
static
void trace_debug_link_cb(struct lttng_session *session, void *priv)
{
- struct soinfo_data *so_data = (struct soinfo_data *) priv;
+ struct bin_info_data *bin_data = (struct bin_info_data *) priv;
tracepoint(lttng_ust_statedump, debug_link,
tracepoint(lttng_ust_statedump, debug_link,
- session, so_data->base_addr_ptr,
- so_data->dbg_file, so_data->crc);
+ session, bin_data->base_addr_ptr,
+ bin_data->dbg_file, bin_data->crc);
-int get_elf_info(struct soinfo_data *so_data, int *has_build_id,
+int get_elf_info(struct bin_info_data *bin_data, int *has_build_id,
int *has_debug_link) {
struct lttng_ust_elf *elf;
int ret = 0;
int *has_debug_link) {
struct lttng_ust_elf *elf;
int ret = 0;
- elf = lttng_ust_elf_create(so_data->resolved_path);
+ elf = lttng_ust_elf_create(bin_data->resolved_path);
if (!elf) {
ret = -1;
goto end;
}
if (!elf) {
ret = -1;
goto end;
}
- ret = lttng_ust_elf_get_memsz(elf, &so_data->memsz);
+ ret = lttng_ust_elf_get_memsz(elf, &bin_data->memsz);
- ret = lttng_ust_elf_get_build_id(elf, &so_data->build_id,
- &so_data->build_id_len, has_build_id);
+ ret = lttng_ust_elf_get_build_id(elf, &bin_data->build_id,
+ &bin_data->build_id_len, has_build_id);
- ret = lttng_ust_elf_get_debug_link(elf, &so_data->dbg_file,
- &so_data->crc, has_debug_link);
+ ret = lttng_ust_elf_get_debug_link(elf, &bin_data->dbg_file,
+ &bin_data->crc, has_debug_link);
- so_data->is_pic = lttng_ust_elf_is_pic(elf);
+ bin_data->is_pic = lttng_ust_elf_is_pic(elf);
end:
lttng_ust_elf_destroy(elf);
end:
lttng_ust_elf_destroy(elf);
-int trace_baddr(struct soinfo_data *so_data)
+int trace_baddr(struct bin_info_data *bin_data)
{
int ret = 0, has_build_id = 0, has_debug_link = 0;
{
int ret = 0, has_build_id = 0, has_debug_link = 0;
- if (!so_data->vdso) {
- ret = get_elf_info(so_data, &has_build_id, &has_debug_link);
+ if (!bin_data->vdso) {
+ ret = get_elf_info(bin_data, &has_build_id, &has_debug_link);
if (ret) {
goto end;
}
} else {
if (ret) {
goto end;
}
} else {
- ret = trace_statedump_event(trace_soinfo_cb, so_data->owner, so_data);
+ ret = trace_statedump_event(trace_bin_info_cb, bin_data->owner,
+ bin_data);
if (ret) {
goto end;
}
if (has_build_id) {
ret = trace_statedump_event(
if (ret) {
goto end;
}
if (has_build_id) {
ret = trace_statedump_event(
- trace_build_id_cb, so_data->owner, so_data);
- free(so_data->build_id);
+ trace_build_id_cb, bin_data->owner, bin_data);
+ free(bin_data->build_id);
if (has_debug_link) {
ret = trace_statedump_event(
if (has_debug_link) {
ret = trace_statedump_event(
- trace_debug_link_cb, so_data->owner, so_data);
- free(so_data->dbg_file);
+ trace_debug_link_cb, bin_data->owner, bin_data);
+ free(bin_data->dbg_file);
-int extract_soinfo_events(struct dl_phdr_info *info, size_t size, void *_data)
+int extract_bin_info_events(struct dl_phdr_info *info, size_t size, void *_data)
{
int j, ret = 0;
struct dl_iterate_data *data = _data;
{
int j, ret = 0;
struct dl_iterate_data *data = _data;
}
for (j = 0; j < info->dlpi_phnum; j++) {
}
for (j = 0; j < info->dlpi_phnum; j++) {
- struct soinfo_data so_data;
+ struct bin_info_data bin_data;
char resolved_path[PATH_MAX];
void *base_addr_ptr;
char resolved_path[PATH_MAX];
void *base_addr_ptr;
break;
resolved_path[path_len] = '\0';
break;
resolved_path[path_len] = '\0';
} else {
snprintf(resolved_path, PATH_MAX - 1, "[vdso]");
} else {
snprintf(resolved_path, PATH_MAX - 1, "[vdso]");
}
} else {
/*
* For regular dl_phdr_info entries check if
}
} else {
/*
* For regular dl_phdr_info entries check if
- * the path to the SO really exists. If not,
+ * the path to the binary really exists. If not,
* treat as vdso and use dlpi_name as 'path'.
*/
if (!realpath(info->dlpi_name, resolved_path)) {
snprintf(resolved_path, PATH_MAX - 1, "[%s]",
info->dlpi_name);
* treat as vdso and use dlpi_name as 'path'.
*/
if (!realpath(info->dlpi_name, resolved_path)) {
snprintf(resolved_path, PATH_MAX - 1, "[%s]",
info->dlpi_name);
- so_data.owner = data->owner;
- so_data.base_addr_ptr = base_addr_ptr;
- so_data.resolved_path = resolved_path;
- ret = trace_baddr(&so_data);
+ bin_data.owner = data->owner;
+ bin_data.base_addr_ptr = base_addr_ptr;
+ bin_data.resolved_path = resolved_path;
+ ret = trace_baddr(&bin_data);
/*
* Iterate through the list of currently loaded shared objects and
* generate events for loadable segments using
/*
* Iterate through the list of currently loaded shared objects and
* generate events for loadable segments using
- * extract_soinfo_events.
+ * extract_bin_info_events.
- dl_iterate_phdr(extract_soinfo_events, &data);
+ dl_iterate_phdr(extract_bin_info_events, &data);