Skip to content

Commit

Permalink
chore: change naming to proc.std{in,out,err} for simplicity
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Susini <[email protected]>
  • Loading branch information
loresuso authored and poiana committed Jun 18, 2024
1 parent 75d1f9c commit d1d021f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions userspace/libsinsp/sinsp_filtercheck_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ static const filtercheck_field_info sinsp_filter_check_thread_fields[] =
{PT_UINT64, EPF_NONE, PF_DEC, "thread.vmrss", "Thread VM RSS (kb)", "For the process main thread, this is the resident non-swapped memory for the process (as kb). For the other threads, this field is zero."},
{PT_UINT64, EPF_TABLE_ONLY, PF_DEC, "thread.vmsize.b", "Thread VM Size (b)", "For the process main thread, this is the total virtual memory for the process (in bytes). For the other threads, this field is zero."},
{PT_UINT64, EPF_TABLE_ONLY, PF_DEC, "thread.vmrss.b", "Thread VM RSS (b)", "For the process main thread, this is the resident non-swapped memory for the process (in bytes). For the other threads, this field is zero."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.fd.stdin.type", "Standard Input fd type", "The type of file descriptor 0, corresponding to stdin, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.fd.stdout.type", "Standard Output fd type", "The type of file descriptor 1, corresponding to stdout, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.fd.stderr.type", "Standard Error fd type", "The type of file descriptor 2, corresponding to stderr, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.fd.stdin.name", "Standard Input fd name", "The name of the file descriptor 0, corresponding to stdin, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.fd.stdout.name", "Standard Output fd name", "The name of the file descriptor 1, corresponding to stdout, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.fd.stderr.name", "Standard Error fd name", "The name of the file descriptor 2, corresponding to stderr, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.stdin.type", "Standard Input fd type", "The type of file descriptor 0, corresponding to stdin, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.stdout.type", "Standard Output fd type", "The type of file descriptor 1, corresponding to stdout, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.stderr.type", "Standard Error fd type", "The type of file descriptor 2, corresponding to stderr, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.stdin.name", "Standard Input fd name", "The name of the file descriptor 0, corresponding to stdin, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.stdout.name", "Standard Output fd name", "The name of the file descriptor 1, corresponding to stdout, of the process generating the event."},
{PT_CHARBUF, EPF_NONE, PF_NA, "proc.stderr.name", "Standard Error fd name", "The name of the file descriptor 2, corresponding to stderr, of the process generating the event."},
};

sinsp_filter_check_thread::sinsp_filter_check_thread()
Expand Down
12 changes: 6 additions & 6 deletions userspace/libsinsp/test/filterchecks/proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ TEST_F(sinsp_with_test_input, PROC_FILTER_stdin_stdout_stderr)

// Exec a process and check stdin, stdout and stderr types and names
evt = generate_execve_enter_and_exit_event(0, 1, 1, 1, 1, "/proc_filter_stdin_stdout_stderr", "proc_filter_stdin_stdout_stderr", "/usr/bin/proc_filter_stdin_stdout_stderr");
ASSERT_EQ(get_field_as_string(evt, "proc.fd.stdin.type"), "ipv4");
ASSERT_EQ(get_field_as_string(evt, "proc.fd.stdout.type"), "ipv4");
ASSERT_EQ(get_field_as_string(evt, "proc.fd.stderr.type"), "ipv4");
ASSERT_EQ(get_field_as_string(evt, "proc.stdin.type"), "ipv4");
ASSERT_EQ(get_field_as_string(evt, "proc.stdout.type"), "ipv4");
ASSERT_EQ(get_field_as_string(evt, "proc.stderr.type"), "ipv4");

std::string tuple_str = std::string(DEFAULT_IPV4_CLIENT_STRING) + ":" + std::to_string(DEFAULT_CLIENT_PORT) + "->" + std::string(DEFAULT_IPV4_SERVER_STRING) + ":" + std::to_string(DEFAULT_SERVER_PORT);
ASSERT_EQ(get_field_as_string(evt, "proc.fd.stdin.name"), tuple_str);
ASSERT_EQ(get_field_as_string(evt, "proc.fd.stdout.name"), tuple_str);
ASSERT_EQ(get_field_as_string(evt, "proc.fd.stderr.name"), tuple_str);
ASSERT_EQ(get_field_as_string(evt, "proc.stdin.name"), tuple_str);
ASSERT_EQ(get_field_as_string(evt, "proc.stdout.name"), tuple_str);
ASSERT_EQ(get_field_as_string(evt, "proc.stderr.name"), tuple_str);
}
#endif

0 comments on commit d1d021f

Please sign in to comment.