1#include <clues/items/process.hxx>
2#include <clues/format.hxx>
3#include <clues/Tracee.hxx>
5#include <clues/private/utils.hxx>
10 BITFLAGS_FORMAT_START(m_options);
11 BITFLAGS_ADD(WEXITED);
12 BITFLAGS_ADD(WSTOPPED);
13 BITFLAGS_ADD(WCONTINUED);
14 BITFLAGS_ADD(WNOHANG);
15 BITFLAGS_ADD(WNOWAIT);
17 BITFLAGS_ADD(__WCLONE);
18 BITFLAGS_ADD(__WNOTHREAD);
20 return BITFLAGS_STR();
26 if (!proc.
readStruct(asPtr(), m_rusage->raw())) {
35 const auto ru = m_rusage->raw();
39 <<
"{utime=" << format::timeval(ru.ru_utime)
40 <<
", stime=" << format::timeval(ru.ru_stime)
41 <<
", maxrss=" << ru.ru_maxrss
42 <<
", ixrss=" << ru.ru_ixrss
43 <<
", idrss=" << ru.ru_idrss
44 <<
", isrss=" << ru.ru_isrss
45 <<
", minflt=" << ru.ru_minflt
46 <<
", majflt=" << ru.ru_majflt
47 <<
", nswap=" << ru.ru_nswap
48 <<
", inblock=" << ru.ru_inblock
49 <<
", oublock=" << ru.ru_oublock
50 <<
", msgsnd=" << ru.ru_msgsnd
51 <<
", msgrcv=" << ru.ru_msgrcv
52 <<
", nsignals=" << ru.ru_nsignals
53 <<
", nvcsw=" << ru.ru_nvcsw
54 <<
", nivcsw=" << ru.ru_nivcsw
60std::string WaitStatusItem::scalarToString()
const {
67 if (m_status->exited()) {
68 ss <<
"WIFEXITED && WEXITSTATUS == " << cosmos::to_integral(*m_status->status());
69 }
else if (m_status->signaled()) {
70 ss <<
"WIFSIGNALED &&";
71 if (m_status->dumped()) {
74 ss <<
"WTERMSIG == " << format::signal(m_status->termSig()->raw(),
false);
Base class for traced processes.
bool readStruct(const ForeignPtr addr, T &out) const
Reads a system call struct from the tracee's address space into out.
void updateData(const Tracee &proc) override
Called upon exit of the system call to update possible out parameters.
std::string str() const override
Returns a human readable string representation of the item.
std::string str() const override
Returns a human readable string representation of the item.