Found an open issue for the same problem with prof...
# windows
e
Found an open issue for the same problem with profiler.py on windows. Any idea when this is expected to be updated? https://github.com/osquery/osquery/issues/5560
a
I don't know if you are a developer at all, but the issue you are pointing out is quite an easy fix. on
tools/test/utils.py
you can substitute the string
"fds": p.num_fds(),
with
"fds": p.num_fds() if platform() == "linux" else -1,
on
get_stats
function. If I remember correctly that's all you need to do.
s
PRs welcome 🙂
👍 1
e
I tried simply setting "fds" to null which I think would effectively be the same and more errors are generated
now it is
Copy code
_pswindows.py", line 957, in cpu_times
    user, system = cext.proc_cpu_times(self.pid)
ProcessLookupError: [Errno 3] No such process
Copy code
Traceback (most recent call last):
  File "osquery-master\tools\analysis\profile.py", line 358, in <module>
    timeout=args.timeout, count=args.count, rounds=args.rounds
  File "osquery-master\tools\analysis\profile.py", line 194, in profile
    result = run_query(shell, query, timeout=timeout, count=count)
  File "osquery-master\tools\analysis\profile.py", line 137, in run_query
    ], timeout=timeout, count=count)
  File "C:\Program Files\osquery\osquery-master\tools\analysis/../tests\utils.py", line 159, in profile_cmd
    current_stats = get_stats(p, step)
  File "C:\Program Files\osquery\osquery-master\tools\analysis/../tests\utils.py", line 131, in get_stats
    utilization = p.cpu_percent(interval=interval)
  File "C:\Users\ehrhardt\AppData\Local\Programs\Python\Python37-32\lib\site-packages\psutil\__init__.py", line 1106, in cpu_percent
    pt2 = self._proc.cpu_times()
  File "C:\Users\ehrhardt\AppData\Local\Programs\Python\Python37-32\lib\site-packages\psutil\_pswindows.py", line 718, in wrapper
    raise convert_oserror(err, pid=self.pid, name=self._name)
psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=4152)
a
That is exactly where I am with
profile.py
on Windows 😄 On Linux works fine. Not sure if it is
psutil
or
osquery
.
Basically it seems that
osqueryi
's process dies while still doing some work and
psutil
clearly gets angry.