libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
clues::Args Struct Reference

Public Attributes

TCLAP::CmdLine cmdline
 
TCLAP::ValueArg< std::underlying_type< cosmos::ProcessID >::type > attach_proc
 Already running process to attach to.
 
TCLAP::ValueArg< std::string > follow_execve
 Controls the behaviour upon execve().
 
TCLAP::ValueArg< std::string > follow_children
 controls the behaviour upon clone()/fork().
 
TCLAP::SwitchArg follow_threads
 controls whether threads within the same process are followed.
 
TCLAP::SwitchArg follow_children_switch
 Short form of 'follow_children yes'.
 
TCLAP::SwitchArg no_initial_threads_attach
 Don't attach all other threads even if follow_children_switch is set.
 
TCLAP::SwitchArg print_fd_info
 Print additional file descriptor information.
 
TCLAP::SwitchArg verbose
 Increase verbosity of tracing output.
 
TCLAP::ValueArg< int > max_value_len
 Maximum length of parameter values to print.
 
TCLAP::SwitchArg list_syscalls
 List system call names and their numbers.
 
TCLAP::ValueArg< std::string > list_abi_syscalls
 List ABI-specific system call names and their numbers.
 
TCLAP::SwitchArg list_abis
 List supported system call ABIs.
 
TCLAP::ValueArg< std::string > syscall_filter
 Configure system calls which to trace.
 

Protected Member Functions

std::vector< std::string > getABIs ()
 

Protected Attributes

TCLAP::ValuesConstraint< std::string > m_abi_constraint
 

Detailed Description

Definition at line 11 of file Args.hxx.

Constructor & Destructor Documentation

◆ Args()

clues::Args::Args ( )

Definition at line 5 of file Args.cxx.

5 :
6 m_abi_constraint{getABIs()},
7 cmdline{"Command line process tracer.\nTo use clues as a front-end pass the command line to execute after '--'", ' ', "0.1"},
9 "p", "process",
10 "attach to the given already running process for tracing.",
11 false,
12 cosmos::to_integral(cosmos::ProcessID::INVALID),
13 "Process ID"},
15 "", "follow-execve",
16 "What to do upon execve() in a tracee: 'yes' (continue tracing; default), 'no' (detach from tracee), 'ask' (interactively ask what to do), 'path:<path>' (continue if new executable matches path), 'glob:<pattern>' (continue if new executable matches glob pattern).",
17 false,
18 "",
19 "configuration string"
20 },
22 "", "follow-children",
23 "What to do upon new child processes appearing via [v]fork() or clone(): 'yes' (automatically attach), 'no' (ignore; default), 'ask' (interactively ask what to do), 'threads' (only follow threads of the same process).",
24 false,
25 "",
26 "configuration string"
27 },
29 "", "threads",
30 "follow/attach all threads within the process. Do not follow fork(). synonym for '--follow-children threads'.",
31 false},
32 // TODO: it seems we need a better command line parsing library to
33 // handle this in a more traditional manner
35 "f", "follow",
36 "synonym for '--follow-children yes'.",
37 false},
39 "1", "no-initial-threads-attach",
40 "when attaching to a running process, don't attach all of the process's threads, only the one specified via -p, even if --follow-children is set.",
41 false},
43 "", "fd-info",
44 "Print detailed information about file descriptors (e.g. type, path, etc.)",
45 false},
46 verbose{
47 "v", "verbose",
48 "increase verbosity of tracing output",
49 false},
51 "s", "max-len",
52 "maximum length of parameter values to print. 0 to to print not at all, -1 to disable truncation.",
53 false,
54 64,
55 "number of bytes"},
57 "", "list-syscalls",
58 "list all known system calls names, then exit.",
59 false},
61 "", "list-abi-syscalls",
62 "list all system calls names and their numbers for the given system call ABI.",
63 false,
64 "",
65 &m_abi_constraint
66 },
68 "", "list-abis",
69 "list the names of system call ABIs supported on this system.",
70 false
71 },
73 "e", "filter",
74 "configuration of system call filters. comma separated list of system call names, optionally prefixed with '!' to negate the meaning.",
75 false,
76 "",
77 "comma separated list of system call names"} {
78
79 cmdline.add(attach_proc);
80 cmdline.add(follow_execve);
81 cmdline.add(follow_children);
82 cmdline.add(follow_threads);
83 cmdline.add(follow_children_switch);
84 cmdline.add(no_initial_threads_attach);
85 cmdline.add(print_fd_info);
86 cmdline.add(verbose);
87 cmdline.add(max_value_len);
88 cmdline.add(list_syscalls);
89 cmdline.add(list_abi_syscalls);
90 cmdline.add(list_abis);
91 cmdline.add(syscall_filter);
92}
TCLAP::SwitchArg list_syscalls
List system call names and their numbers.
Definition Args.hxx:39
TCLAP::ValueArg< std::string > follow_execve
Controls the behaviour upon execve().
Definition Args.hxx:23
TCLAP::SwitchArg list_abis
List supported system call ABIs.
Definition Args.hxx:43
TCLAP::ValueArg< std::string > follow_children
controls the behaviour upon clone()/fork().
Definition Args.hxx:25
TCLAP::SwitchArg print_fd_info
Print additional file descriptor information.
Definition Args.hxx:33
TCLAP::ValueArg< std::string > syscall_filter
Configure system calls which to trace.
Definition Args.hxx:45
TCLAP::SwitchArg no_initial_threads_attach
Don't attach all other threads even if follow_children_switch is set.
Definition Args.hxx:31
TCLAP::SwitchArg follow_threads
controls whether threads within the same process are followed.
Definition Args.hxx:27
TCLAP::SwitchArg follow_children_switch
Short form of 'follow_children yes'.
Definition Args.hxx:29
TCLAP::ValueArg< int > max_value_len
Maximum length of parameter values to print.
Definition Args.hxx:37
TCLAP::SwitchArg verbose
Increase verbosity of tracing output.
Definition Args.hxx:35
TCLAP::ValueArg< std::string > list_abi_syscalls
List ABI-specific system call names and their numbers.
Definition Args.hxx:41
TCLAP::ValueArg< std::underlying_type< cosmos::ProcessID >::type > attach_proc
Already running process to attach to.
Definition Args.hxx:21

Member Function Documentation

◆ getABIs()

std::vector< std::string > clues::Args::getABIs ( )
protected

Definition at line 94 of file Args.cxx.

94 {
95 return std::vector<std::string>{
96 "i386", "x86-64", "x32", "aarch64"
97 };
98}

Member Data Documentation

◆ attach_proc

TCLAP::ValueArg<std::underlying_type<cosmos::ProcessID>::type> clues::Args::attach_proc

Already running process to attach to.

Definition at line 21 of file Args.hxx.

◆ cmdline

TCLAP::CmdLine clues::Args::cmdline

Definition at line 19 of file Args.hxx.

◆ follow_children

TCLAP::ValueArg<std::string> clues::Args::follow_children

controls the behaviour upon clone()/fork().

Definition at line 25 of file Args.hxx.

◆ follow_children_switch

TCLAP::SwitchArg clues::Args::follow_children_switch

Short form of 'follow_children yes'.

Definition at line 29 of file Args.hxx.

◆ follow_execve

TCLAP::ValueArg<std::string> clues::Args::follow_execve

Controls the behaviour upon execve().

Definition at line 23 of file Args.hxx.

◆ follow_threads

TCLAP::SwitchArg clues::Args::follow_threads

controls whether threads within the same process are followed.

Definition at line 27 of file Args.hxx.

◆ list_abi_syscalls

TCLAP::ValueArg<std::string> clues::Args::list_abi_syscalls

List ABI-specific system call names and their numbers.

Definition at line 41 of file Args.hxx.

◆ list_abis

TCLAP::SwitchArg clues::Args::list_abis

List supported system call ABIs.

Definition at line 43 of file Args.hxx.

◆ list_syscalls

TCLAP::SwitchArg clues::Args::list_syscalls

List system call names and their numbers.

Definition at line 39 of file Args.hxx.

◆ m_abi_constraint

TCLAP::ValuesConstraint<std::string> clues::Args::m_abi_constraint
protected

Definition at line 13 of file Args.hxx.

◆ max_value_len

TCLAP::ValueArg<int> clues::Args::max_value_len

Maximum length of parameter values to print.

Definition at line 37 of file Args.hxx.

◆ no_initial_threads_attach

TCLAP::SwitchArg clues::Args::no_initial_threads_attach

Don't attach all other threads even if follow_children_switch is set.

Definition at line 31 of file Args.hxx.

◆ print_fd_info

TCLAP::SwitchArg clues::Args::print_fd_info

Print additional file descriptor information.

Definition at line 33 of file Args.hxx.

◆ syscall_filter

TCLAP::ValueArg<std::string> clues::Args::syscall_filter

Configure system calls which to trace.

Definition at line 45 of file Args.hxx.

◆ verbose

TCLAP::SwitchArg clues::Args::verbose

Increase verbosity of tracing output.

Definition at line 35 of file Args.hxx.


The documentation for this struct was generated from the following files: