bt_list_for_each_entry(callsite, &cs_dups->head, node) {
if (i != 0)
fprintf(pos->fp, ",");
- fprintf(pos->fp, "%s@%s:%" PRIu64 "",
- callsite->func, callsite->file,
- callsite->line);
+ if (CTF_CALLSITE_FIELD_IS_SET(callsite, ip)) {
+ fprintf(pos->fp, "%s@0x%" PRIx64 ":%s:%" PRIu64 "",
+ callsite->func, callsite->ip, callsite->file,
+ callsite->line);
+ } else {
+ fprintf(pos->fp, "%s:%s:%" PRIu64 "",
+ callsite->func, callsite->file,
+ callsite->line);
+ }
i++;
}
fprintf(pos->fp, "]");
goto error;
}
CTF_CALLSITE_SET_FIELD(callsite, line);
+ } else if (!strcmp(left, "ip")) {
+ if (CTF_CALLSITE_FIELD_IS_SET(callsite, ip)) {
+ fprintf(fd, "[error] %s: ip already declared in callsite declaration\n", __func__);
+ ret = -EPERM;
+ goto error;
+ }
+ ret = get_unary_unsigned(&node->u.ctf_expression.right, &callsite->ip);
+ if (ret) {
+ fprintf(fd, "[error] %s: unexpected unary expression for callsite ip\n", __func__);
+ ret = -EINVAL;
+ goto error;
+ }
+ CTF_CALLSITE_SET_FIELD(callsite, ip);
} else {
fprintf(fd, "[warning] %s: attribute \"%s\" is unknown in callsite declaration.\n", __func__, left);
}
char *func;
char *file;
uint64_t line;
+ uint64_t ip;
struct bt_list_head node;
enum { /* Fields populated mask */
CTF_CALLSITE_name = (1U << 0),
CTF_CALLSITE_func = (1U << 1),
CTF_CALLSITE_file = (1U << 2),
CTF_CALLSITE_line = (1U << 3),
+ CTF_CALLSITE_ip = (1U << 4),
} field_mask;
};