Skip to content

feat:Added handling for syscall events#29

Closed
a-poljakow wants to merge 1 commit intosiemens:mainfrom
a-poljakow:Syscall-Event-Handling
Closed

feat:Added handling for syscall events#29
a-poljakow wants to merge 1 commit intosiemens:mainfrom
a-poljakow:Syscall-Event-Handling

Conversation

@a-poljakow
Copy link

Added handling of the the prefix of syscall events
Also added the tid to the event fields from the common fields

Fixes #28

}
free(fields);

if(event_system_is("syscalls", event)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only on the syscalls event? Is there a reason to not add it to all events?

static const char *lttng_field_name_replace_common_pid_with_tid(const char *field_name)
{
static char outbuf[64];
const char from[] = "common_pid";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only one common_pid field that needs to be replaced. By that, the code can simply strncmp against common_pid and return tid when matching.

const char *event_syscall_prefix_name(const char *prefix, const struct tep_event *event)
{
static char outbuf[64];
const char *event_name= event->name + 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check if the strlen(event->name) > 4.


} else if (bt_field_class_type_is(data_class_type,
BT_FIELD_CLASS_TYPE_SIGNED_INTEGER)) {
int64_t typed_val = convert_to_signed(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is wrong with the type conversion. The following script triggers a babeltrace assertion:

sudo trace-cmd record -C mono -e 'syscalls:sys_enter_futex' sleep 1
babeltrace2 trace.dat 
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:63 Babeltrace 2 library precondition not satisfied.
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:65 ------------------------------------------------------------------------
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:66 Condition ID: `pre:field-integer-signed-get-value:is-field-set:field`.
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:68 Function: bt_field_integer_signed_get_value().
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:69 ------------------------------------------------------------------------
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:70 Error is:
03-09 11:11:23.475 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:72 Field is not set: addr=0x563ad3f0b730, is-set=0, is-frozen=0, class-addr=0x563ad3eb9970, class-type=SIGNED_INTEGER
03-09 11:11:23.476 295635 295635 F LIB/ASSERT-COND bt_lib_assert_cond_failed@lib/assert-cond.c:75 Aborting...

Signed-off-by: Andre Poljakow <a.poljakow@siemens.com>
@fmoessbauer
Copy link
Member

Integrated into #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syscall formatting

2 participants