Skip to content

Skip proc scan in sinsp_dumper w/ threads_from_sinsp=true#1164

Merged
mstemm merged 1 commit intodevfrom
skip-proc-scan-dumper
Jul 9, 2018
Merged

Skip proc scan in sinsp_dumper w/ threads_from_sinsp=true#1164
mstemm merged 1 commit intodevfrom
skip-proc-scan-dumper

Conversation

@mstemm
Copy link
Contributor

@mstemm mstemm commented Jun 29, 2018

The way sinsp_dumper::open() and ::fdopen() behaved was slightly
inconsistent. fdopen() would unconditionally call scap_dump_open with
skip_proc_scan=true, and open() would unconditionally call
scap_dump_open with skip_proc_scan=false, regardless of the value of
threads_from_sinsp.

threads_from_sinsp=true is a strong indicator that scap_dump_open
should not scan /proc for processes, as sinsp is going to write the
threads list to the dump file immediately after opening.

So tie threads_from_sinsp to whether or not to skip the proc
scan--threads_from_sinsp=true implies skip_proc_scan.

For fdopen(), this is a change from unconditional to honoring
threads_from_sinsp. For open(), it requires adding a skip_proc_scan
argument to scap_dump_open, setting it to false in other calls to
scap_dump_open outside of sinsp_dumper::open(), and tying it to
threads_from_sinsp in sinsp_dumper::open().

The way sinsp_dumper::open() and ::fdopen() behaved was slightly
inconsistent. fdopen() would unconditionally call scap_dump_open with
skip_proc_scan=true, and open() would unconditionally call
scap_dump_open with skip_proc_scan=false, regardless of the value of
threads_from_sinsp.

threads_from_sinsp=true is a strong indicator that scap_dump_open
should *not* scan /proc for processes, as sinsp is going to write the
threads list to the dump file immediately after opening.

So tie threads_from_sinsp to whether or not to skip the proc
scan--threads_from_sinsp=true implies skip_proc_scan.

For fdopen(), this is a change from unconditional to honoring
threads_from_sinsp. For open(), it requires adding a skip_proc_scan
argument to scap_dump_open, setting it to false in other calls to
scap_dump_open outside of sinsp_dumper::open(), and tying it to
threads_from_sinsp in sinsp_dumper::open().
@mstemm mstemm requested a review from mattpag June 29, 2018 01:13
Copy link
Contributor

@mattpag mattpag left a comment

Choose a reason for hiding this comment

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

lgtm!

@mstemm mstemm merged commit 57ea297 into dev Jul 9, 2018
@mstemm mstemm deleted the skip-proc-scan-dumper branch July 9, 2018 21:39
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.

2 participants