seph
seph
seph
seph
Stefano Bonicatti
12/30/2019, 11:42 AMtheopolis
theopolis
theopolis
buck-out/cmake
folder to checkout repos and patch files, then run BUCK with static configuration to expect third-party code in ./buck-out/cmake
. Then the significant changes to BUCK logic only include adapting the compile logic in CMake, which should be easy.
This will enable us to move to newer third-party library versions and remove all dependence on the facebook pre-built layer.
The downside of me working on it is that someone else might be able to move faster.
Suggestions for what I should work on / how I could approach what I referenced above?alessandrogario
Ivanlei
01/22/2020, 11:23 PMseph
seph
zwass
Stefano Bonicatti
01/31/2020, 3:32 PMseph
thor
samuel
02/01/2020, 1:08 AMthor
Stefano Bonicatti
02/03/2020, 4:11 PMAntoinette
02/05/2020, 5:19 PMprofile.py
script uses utils.py in tools/tests/
which uses python’s psutil
library to collect process stats for osqueryi as its running given queries.
The script turns 5 stats:
Utilization (U): Utilization is calculated by taking the average of non-0 results of the cpu_percent(interval=1)
function in psutils.Process()
. This value can be greater than 100% for processes with threads running across different CPUs. The script sets an interval of 1 meaning that the function compares process time to system CPU times elapsed before and after the 1 second interval. This is a blocking call.
CPU time (C): CPU time uses the psutils.Process()
's cpu_times()
function. It returns a named tuple containing user, system, children_user, system_user, and iowait
• user: time spent in user mode.
• system: time spent in kernel mode.
• children_user: user time of all child processes (always 0 on Windows and macOS).
• system_user: user time of all child processes (always 0 on Windows and macOS).
• iowait: (Linux) time spent waiting for blocking I/O to complete. This value is excluded from user and system times count (because the CPU is not doing any work).
The profile script adds user and system together for the CPU Time output.
Duration (D):
Duration is calculated by taking the subtracting start_time - 2
from the current time. The start time is set before the script starts the osqueryi process to run the query. (I’m not very sure about why the 2 is there. I don’t know how useful of a metric this is when compared to the cpu time, but someone might have better insights.)
fds (F): Uses the num_fds()
function and returns the file descriptors used by the osqueryi process during query execution
Memory (M): Uses the memory_info_ex()
command which is deprecated. Psutils documentation suggests using memory_info()
instead. The function returns a named tuple and the script uses the rss
value in the tuple. RSS stands for resident set size and is the non-swapped physical memory used by the process. This should match the RES column in top
.zwass
Antoinette
02/05/2020, 5:35 PMtheopolis
farfella
02/09/2020, 7:04 PMzwass
Antoinette
02/12/2020, 6:50 PMselect * from osquery_schedule;
as a scheduled query and can see the results being returned in elasticsearch but if we try to do that query in osqueryi
the fields are zeroed out.Antoinette
02/12/2020, 6:50 PMosqueryi
have knowledge of the scheduled queries but no knowledge of the metrics around them?seph
seph
Stefano Bonicatti
02/20/2020, 11:08 PM