JakWai01 / lurk

A pretty (simple) alternative to strace
Apache License 2.0
871 stars 28 forks source link

Enhance output for system calls by making them more detailed and human-readable #47

Open odiferousmint opened 2 months ago

odiferousmint commented 2 months ago

Hello. Any plans to include more detailed and human-readable output? For example:

strace:

prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0

lurk:

[6314] prlimit64(0, 3, 0x0, 0x7FFFFFFFB750) = 0

So, it would be nice if it would have a detailed and human-readable information about system calls and their parameters by converting raw values into more understandable formats. strace translates the raw data into meaningful descriptions by interpreting the arguments and constants associated with them. You would need to have a predefined list of constants that map integer values to their symbolic names (e.g. RLIMIT_STACK). In this case the raw value 0x7FFFFFFFB750 is dereferenced to read the rlimit64 structure it points to, and it extracts the values of rlim_cur and rlim_max from the structure.