Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package extrace for openSUSE:Factory checked in at 2023-02-01 16:40:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/extrace (Old) and /work/SRC/openSUSE:Factory/.extrace.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "extrace" Wed Feb 1 16:40:05 2023 rev:2 rq:1062441 version:0.9 Changes: -------- --- /work/SRC/openSUSE:Factory/extrace/extrace.changes 2021-05-12 19:33:02.910841956 +0200 +++ /work/SRC/openSUSE:Factory/.extrace.new.32243/extrace.changes 2023-02-01 16:44:04.203472611 +0100 @@ -1,0 +2,9 @@ +Wed Feb 1 09:51:26 UTC 2023 - Wolfgang Frisch <[email protected]> + +- Update to version 0.9: + * Add option -Q to suppress runtime errors + * With -t, print time when process execed + * Quit when parent specified in -p exits + * Fix likely root cause for pid_db overflow + +------------------------------------------------------------------- Old: ---- extrace-1575153394.f02ef88.obscpio New: ---- extrace-0.9.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ extrace.spec ++++++ --- /var/tmp/diff_new_pack.oHC89O/_old 2023-02-01 16:44:04.843476094 +0100 +++ /var/tmp/diff_new_pack.oHC89O/_new 2023-02-01 16:44:04.895476377 +0100 @@ -1,7 +1,7 @@ # # spec file for package extrace # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,8 +17,8 @@ Name: extrace -Version: 1575153394.f02ef88 -Release: 2 +Version: 0.9 +Release: 0 Summary: Traces all program executions occurring on a system License: GPL-2.0-only URL: https://github.com/leahneukirchen/extrace ++++++ _service ++++++ --- /var/tmp/diff_new_pack.oHC89O/_old 2023-02-01 16:44:05.019477052 +0100 +++ /var/tmp/diff_new_pack.oHC89O/_new 2023-02-01 16:44:05.031477117 +0100 @@ -3,6 +3,8 @@ <param name="url">https://github.com/leahneukirchen/extrace.git</param> <param name="scm">git</param> <param name="filename">extrace</param> + <param name="revision">v0.9</param> + <param name="versionformat">0.9</param> </service> <service name="tar" mode="buildtime" /> <service name="recompress" mode="buildtime"> ++++++ extrace-1575153394.f02ef88.obscpio -> extrace-0.9.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extrace-1575153394.f02ef88/NEWS.md new/extrace-0.9/NEWS.md --- old/extrace-1575153394.f02ef88/NEWS.md 2019-11-30 23:36:34.000000000 +0100 +++ new/extrace-0.9/NEWS.md 2022-01-19 19:03:33.000000000 +0100 @@ -1,3 +1,15 @@ +## 0.9 (2022-01-19) + +* With `-t`, print time when process execed. +* Fix `-p` flag, which was a regression in 0.8. +* Quit when parent specified in `-p` exits. +* Fix likely root cause for pid_db overflow. + +## 0.8 (2021-08-05) + +* extrace: add option -Q to suppress runtime errors. +* Small fixes. + ## 0.7 (2019-02-08) * pwait: detect and warn for non-existing PID. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extrace-1575153394.f02ef88/extrace.1 new/extrace-0.9/extrace.1 --- old/extrace-1575153394.f02ef88/extrace.1 2019-11-30 23:36:34.000000000 +0100 +++ new/extrace-0.9/extrace.1 2022-01-19 19:03:33.000000000 +0100 @@ -6,7 +6,7 @@ .Nd trace exec() calls system-wide .Sh SYNOPSIS .Nm -.Op Fl deflqtu +.Op Fl deflqQtu .Op Fl o Ar file .Op Fl p Ar pid | cmd\ ... .Sh DESCRIPTION @@ -33,6 +33,8 @@ Suppress printing of .Xr exec 3 arguments. +.It Fl Q +Suppress printing of runtime errors. .It Fl t Also display process exit status and duration. .It Fl u diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extrace-1575153394.f02ef88/extrace.c new/extrace-0.9/extrace.c --- old/extrace-1575153394.f02ef88/extrace.c 2019-11-30 23:36:34.000000000 +0100 +++ new/extrace-0.9/extrace.c 2022-01-19 19:03:33.000000000 +0100 @@ -3,7 +3,7 @@ * Requires CONFIG_CONNECTOR=y and CONFIG_PROC_EVENTS=y. * Requires root or "setcap cap_net_admin+ep extrace". * - * Usage: extrace [-deflqu] [-o FILE] [-p PID|CMD...] + * Usage: extrace [-deflqQtu] [-o FILE] [-p PID|CMD...] * default: show all exec(), globally * -p PID only show exec() descendant of PID * CMD... run CMD... and only show exec() descendant of it @@ -13,6 +13,7 @@ * -f flat output: no indentation * -l print full path of argv[0] * -q don't print exec() arguments + * -Q don't print error messages * -u print user of process * * Copyright (C) 2014-2019 Leah Neukirchen <[email protected]> @@ -66,6 +67,7 @@ #include <limits.h> #include <pwd.h> #include <signal.h> +#include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -94,6 +96,7 @@ int run = 0; int full_path = 0; int show_args = 1; +int show_errors = 1; int show_cwd = 0; int show_env = 0; int show_exit = 0; @@ -111,6 +114,16 @@ char cmdline[CMDLINE_DB_MAX]; } pid_db[PID_DB_SIZE]; +static void +print_runtime_error(const char* fmt, ...) { + va_list ap; + if (show_errors) { + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + } +} + static int open_proc_dir(pid_t pid) { char name[48]; @@ -127,6 +140,9 @@ char *s; int fd, d, i; + if (pid == 1 && parent == 1) + return 0; + snprintf(name, sizeof name, "/proc/%d/stat", pid); if ((fd = open(name, O_RDONLY)) < 0) @@ -303,7 +319,7 @@ int i = 0; int proc_dir_fd = open_proc_dir(pid); if (proc_dir_fd < 0) { - fprintf(stderr, + print_runtime_error( "extrace: process vanished before notification: pid %d\n", pid); return; @@ -329,14 +345,16 @@ d = pid_depth(pid); if (d < 0) { - if (*cmdline) { - fprintf(stderr, - "extrace: process vanished before we found its parent: pid %d: %s\n", - pid, cmdline); - } else { - fprintf(stderr, - "extrace: process vanished without a name: pid %d\n", - pid); + if (parent == 1) { + if (*cmdline) { + print_runtime_error( + "extrace: process vanished before we found its parent: pid %d: %s\n", + pid, cmdline); + } else { + print_runtime_error( + "extrace: process vanished without a name: pid %d\n", + pid); + } } close(proc_dir_fd); return; @@ -344,12 +362,21 @@ if (show_exit || !flat) { for (i = 0; i < PID_DB_SIZE - 1; i++) - if (pid_db[i].pid == 0) + if (pid_db[i].pid == 0 || pid_db[i].pid == pid) break; if (i == PID_DB_SIZE - 1) - fprintf(stderr, "extrace: warning: pid_db of " + print_runtime_error("extrace: warning: pid_db of " "size %d overflowed\n", PID_DB_SIZE); + if (show_exit && pid_db[i].pid == pid) { + if (!flat) + fprintf(output, "%*s", 2*d, ""); + fprintf(output, "%d- %s execed time=%.3fs\n", + pid, + pid_db[i].cmdline, + (ev->timestamp_ns - pid_db[i].start) / 1e9); + } + pid_db[i].pid = pid; pid_db[i].depth = d; pid_db[i].start = ev->timestamp_ns; @@ -413,6 +440,9 @@ pid_t pid = ev->event_data.exit.process_pid; int i; + if (pid == parent) + quit = 1; + for (i = 0; i < PID_DB_SIZE; i++) if (pid_db[i].pid == pid) break; @@ -482,7 +512,7 @@ output = stdout; - while ((opt = getopt(argc, argv, "+deflo:p:qtwu")) != -1) + while ((opt = getopt(argc, argv, "+deflo:p:qQtwu")) != -1) switch (opt) { case 'd': show_cwd = 1; break; case 'e': show_env = 1; break; @@ -490,6 +520,7 @@ case 'l': full_path = 1; break; case 'p': parent = parse_pid(optarg); break; case 'q': show_args = 0; break; + case 'Q': show_errors = 0; break; case 't': show_exit = 1; break; case 'o': output = fopen(optarg, "w"); @@ -505,7 +536,7 @@ if (parent != 1 && optind != argc) { usage: - fprintf(stderr, "Usage: extrace [-deflqt] [-o FILE] [-p PID|CMD...]\n"); + fprintf(stderr, "Usage: extrace [-deflqQtu] [-o FILE] [-p PID|CMD...]\n"); exit(1); } @@ -593,7 +624,7 @@ if (last_seq[cproc->cpu] && cmsg->seq != last_seq[cproc->cpu] + 1) - fprintf(stderr, + print_runtime_error( "extrace: out of order message on cpu %d\n", cproc->cpu); last_seq[cproc->cpu] = cmsg->seq; ++++++ extrace.obsinfo ++++++ --- /var/tmp/diff_new_pack.oHC89O/_old 2023-02-01 16:44:05.151477770 +0100 +++ /var/tmp/diff_new_pack.oHC89O/_new 2023-02-01 16:44:05.155477792 +0100 @@ -1,6 +1,5 @@ name: extrace -version: 1575153394.f02ef88 -mtime: 1575153394 -commit: f02ef88edf617245cbd33813561b46ccadcabfb3 - +version: 0.9 +mtime: 1642615413 +commit: 171c574f6e66ee69194ec820210b126785e94526
