diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2016-01-04 23:28:01 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2016-01-04 23:28:01 -0300 |
commit | 2a41abbed0dfb70447a9c83b17b6d98fcb3c65c6 (patch) | |
tree | 1b45eb4a8ac37f346b82f5f6dcfaa5f9e42aad1a /profile.c | |
parent | 2f11d2b1088dcd5d8391d4bd61e342db6198be07 (diff) | |
download | profile-2a41abbed0dfb70447a9c83b17b6d98fcb3c65c6.tar.gz |
Finish struct rusage struct fields.
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -120,7 +120,7 @@ int main(int argc, char **argv) O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); } - process_child(prog_name, args, fd_out); + spawn_child(prog_name, args, fd_out); } else { @@ -131,9 +131,25 @@ int main(int argc, char **argv) getrusage(who, &usage); - printf("user CPU time used:\t%lu %lu\n", usage.ru_utime.tv_sec, usage.ru_utime.tv_usec); - printf("system CPU time used:\t%lu %lu\n", usage.ru_stime.tv_sec, usage.ru_stime.tv_usec); - printf("residet set size used: %ld\n", usage.ru_maxrss); + printf("user CPU time used: %lus %luus\n", usage.ru_utime.tv_sec, usage.ru_utime.tv_usec); + printf("system CPU time used: %lus %luus\n", usage.ru_stime.tv_sec, usage.ru_stime.tv_usec); + printf("residet set size used: %ld\n", usage.ru_maxrss); + printf("page reclaims (soft page faults): %ld\n", usage.ru_minflt); + printf("page faults (hard page faults): %ld\n", usage.ru_majflt); + printf("block input operations: %ld\n", usage.ru_inblock); + printf("block output operations: %ld\n", usage.ru_oublock); + printf("voluntary context switches: %ld\n", usage.ru_nvcsw); + printf("involuntary context switches: %ld\n", usage.ru_nivcsw); + +#ifdef _ALLOW_UNMANTAINED + printf("integral shared memory size: %ld\n", usage.ru_ixrss); + printf("integral unshared data size: %ld\n", usage.ru_idrss); + printf("integral unshared stack size: %ld\n", usage.ru_isrss); + printf("swaps: %ld\n", usage.ru_nswap); + printf("IPC messages sent: %ld\n", usage.ru_msgsnd); + printf("IPC messages received: %ld\n", usage.ru_msgrcv); + printf("signals received: %ld\n", usage.ru_nsignals); +#endif } return status; |