Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package iotop-c for openSUSE:Factory checked in at 2025-05-08 18:23:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/iotop-c (Old) and /work/SRC/openSUSE:Factory/.iotop-c.new.30101 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "iotop-c" Thu May 8 18:23:00 2025 rev:9 rq:1275421 version:1.29 Changes: -------- --- /work/SRC/openSUSE:Factory/iotop-c/iotop-c.changes 2025-01-13 18:07:22.857326823 +0100 +++ /work/SRC/openSUSE:Factory/.iotop-c.new.30101/iotop-c.changes 2025-05-08 18:25:48.802564615 +0200 @@ -1,0 +2,13 @@ +Thu May 8 07:02:33 UTC 2025 - Michael Vetter <mvet...@suse.com> + +- Update to 1.29: + * Fix Linux kernel incompatible struct taskstats + +------------------------------------------------------------------- +Thu May 8 07:02:16 UTC 2025 - Michael Vetter <mvet...@suse.com> + +- Update to 1.28: + * add option to specify bin directory #78 + * fix batch mode + +------------------------------------------------------------------- Old: ---- iotop-c-1.27.tar.xz New: ---- iotop-c-1.29.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ iotop-c.spec ++++++ --- /var/tmp/diff_new_pack.ppnJov/_old 2025-05-08 18:25:49.246583133 +0200 +++ /var/tmp/diff_new_pack.ppnJov/_new 2025-05-08 18:25:49.246583133 +0200 @@ -17,7 +17,7 @@ Name: iotop-c -Version: 1.27 +Version: 1.29 Release: 0 Summary: Simple top-like I/O monitor (implemented in C) License: GPL-2.0-or-later ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ppnJov/_old 2025-05-08 18:25:49.286584801 +0200 +++ /var/tmp/diff_new_pack.ppnJov/_new 2025-05-08 18:25:49.290584968 +0200 @@ -1,10 +1,9 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="versionformat">1.27</param> + <param name="versionformat">1.29</param> <param name="url">https://github.com/Tomas-M/iotop</param> <param name="scm">git</param> <param name="changesgenerate">disable</param> - <param name="exclude">.*</param> <param name="filename">iotop-c</param> </service> <service name="recompress" mode="disabled"> ++++++ iotop-c-1.27.tar.xz -> iotop-c-1.29.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/.github/workflows/codeql-analysis.yml new/iotop-c-1.29/.github/workflows/codeql-analysis.yml --- old/iotop-c-1.27/.github/workflows/codeql-analysis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/iotop-c-1.29/.github/workflows/codeql-analysis.yml 2025-05-07 00:18:44.000000000 +0200 @@ -0,0 +1,39 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '30 5 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'cpp' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Build + run: make -j + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/.gitignore new/iotop-c-1.29/.gitignore --- old/iotop-c-1.27/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/iotop-c-1.29/.gitignore 2025-05-07 00:18:44.000000000 +0200 @@ -0,0 +1,3 @@ +bld/* +*.swp +iotop Binary files old/iotop-c-1.27/.sample/screenshot.png and new/iotop-c-1.29/.sample/screenshot.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/Makefile new/iotop-c-1.29/Makefile --- old/iotop-c-1.27/Makefile 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/Makefile 2025-05-07 00:18:44.000000000 +0200 @@ -36,6 +36,7 @@ endif PREFIX?=$(DESTDIR)/usr +BINDIR?=$(PREFIX)/sbin INSTALL?=install STRIP?=strip @@ -57,7 +58,7 @@ HAVESREA:=$(shell if $(CC) -mno-stackrealign -xc -c /dev/null -o /dev/null >/dev/null 2>/dev/null;then echo yes;else echo no;fi) # old comiplers do not have -Wdate-time HAVEWDTI:=$(shell if $(CC) -Wdate-time -xc -c /dev/null -o /dev/null >/dev/null 2>/dev/null;then echo yes;else echo no;fi) -# old compilers can not generate dependecies +# old compilers can not generate dependencies HAVEDEPS:=$(shell if $(CC) -MM -MT /dev/null -MF /dev/null /dev/null >/dev/null 2>/dev/null;then echo yes;else echo no;fi) # old compilers do not understand C standard HAVECSTD:=$(shell if $(CC) --std=gnu89 -xc -c /dev/null -o /dev/null >/dev/null 2>/dev/null;then echo yes;else echo no;fi) @@ -145,19 +146,19 @@ $(E) STRIP $(TARGET) $(Q)$(STRIP) $(TARGET) $(E) INSTALL $(TARGET) - $(Q)$(INSTALL) -D -m 0755 $(TARGET) $(PREFIX)/sbin/$(TARGET) + $(Q)$(INSTALL) -D -m 0755 $(TARGET) $(BINDIR)/$(TARGET) $(Q)$(INSTALL) -D -m 0644 iotop.8 $(PREFIX)/share/man/man8/iotop.8 uninstall: $(E) UNINSTALL $(TARGET) - $(Q)rm -f $(PREFIX)/sbin/$(TARGET) + $(Q)rm -f $(BINDIR)/$(TARGET) $(Q)rm -f $(PREFIX)/share/man/man8/iotop.8 bld/.mkdir: $(Q)mkdir -p bld $(Q)touch bld/.mkdir -VER:=$(shell grep VERSION src/iotop.h|tr -d '\"'|awk '{print $$3}') +VER:=$(shell grep ' VERSION ' src/iotop.h|tr -d '\"'|awk '{print $$3}') mkotar: $(MAKE) clean -dh_clean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/README.md new/iotop-c-1.29/README.md --- old/iotop-c-1.27/README.md 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/README.md 2025-05-07 00:18:44.000000000 +0200 @@ -199,7 +199,9 @@ -g TYPE, --grtype=TYPE set graph data source (io, r, w, rw and sw) -R, --reverse-graph reverse GRAPH column direction --no-reverse-graph do not reverse GRAPH column direction - -q, --quiet suppress some lines of header (implies --batch) + -q, --quiet print column names only on the first run (implies --batch) + a second -q will also suppress the first run column names + a third -q will suppress the I/O summary -x, --dead-x show exited processes/threads with letter x --no-dead-x show exited processes/threads with background -e, --hide-exited hide exited processes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/debian/changelog new/iotop-c-1.29/debian/changelog --- old/iotop-c-1.27/debian/changelog 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/debian/changelog 2025-05-07 00:18:44.000000000 +0200 @@ -1,10 +1,26 @@ +iotop-c (1.29-1) unstable; urgency=medium + + * Update to new upstream release of 1.29 + - fix backward incompatible change in kernel + struct taskstats + + -- Boian Bonev <bbo...@ipacct.com> Tue, 06 May 2025 22:09:06 +0000 + +iotop-c (1.28-1) unstable; urgency=medium + + * Update to new upstream release of 1.28 + - fix batch mode + * Bump standards to 4.7.2, no changes + + -- Boian Bonev <bbo...@ipacct.com> Fri, 02 May 2025 15:07:42 +0000 + iotop-c (1.27-1) unstable; urgency=medium * Update to new upstream release of 1.27 * Bump standards to 4.7.0, no changes * Change pkg-config to pkgconf - -- <bbo...@ipacct.com> Mon, 13 Jan 2025 10:36:15 +0000 + -- Boian Bonev <bbo...@ipacct.com> Mon, 13 Jan 2025 10:36:15 +0000 iotop-c (1.26-1) unstable; urgency=medium diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/debian/control new/iotop-c-1.29/debian/control --- old/iotop-c-1.27/debian/control 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/debian/control 2025-05-07 00:18:44.000000000 +0200 @@ -6,7 +6,7 @@ debhelper-compat (= 13), libncurses-dev, pkgconf, -Standards-Version: 4.7.0 +Standards-Version: 4.7.2 Rules-Requires-Root: no Homepage: https://github.com/Tomas-M/iotop Vcs-Browser: https://github.com/Tomas-M/iotop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/fedora/iotop-c.spec new/iotop-c-1.29/fedora/iotop-c.spec --- old/iotop-c-1.27/fedora/iotop-c.spec 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/fedora/iotop-c.spec 2025-05-07 00:18:44.000000000 +0200 @@ -1,5 +1,5 @@ Name: iotop-c -Version: 1.27 +Version: 1.29 Release: 1%{?dist} Summary: Simple top-like I/O monitor (implemented in C) @@ -44,22 +44,37 @@ NO_FLTO=1 %make_build %install -V=1 STRIP=: %make_install +V=1 STRIP=: BINDIR=$RPM_BUILD_ROOT%{_bindir} %make_install %files %license COPYING %license LICENSE -%{_sbindir}/iotop +%{_bindir}/iotop %{_mandir}/man8/iotop.8* %changelog -* Mon 13 Jan 2025 Boian Bonev <bbo...@ipacct.com> - 1.27-1 +* Tue May 6 2025 Boian Bonev <bbo...@ipacct.com> - 1.29-1 +- Update to latest ver 1.29 + +* Fri May 2 2025 Boian Bonev <bbo...@ipacct.com> - 1.28-1 +- Update to latest ver 1.28 + +* Mon Feb 10 2025 Michal Hlavinka <mhlav...@redhat.com> - 1.27-4 +- rebuild + +* Wed Jan 22 2025 Michal Hlavinka <mhlav...@redhat.com> - 1.27-3 +- update for bin and sbin merge https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin + +* Fri Jan 17 2025 Fedora Release Engineering <rel...@fedoraproject.org> - 1.27-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Mon Jan 13 2025 Boian Bonev <bbo...@ipacct.com> - 1.27-1 - Update to latest ver 1.27 * Thu Jul 18 2024 Fedora Release Engineering <rel...@fedoraproject.org> - 1.26-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild -* Sat 03 Feb 2024 Boian Bonev <bbo...@ipacct.com> - 1.26-1 +* Sat Feb 03 2024 Boian Bonev <bbo...@ipacct.com> - 1.26-1 - Update to latest ver 1.26 * Thu Feb 01 2024 Michal Hlavinka <mhlav...@redhat.com> - 1.25-4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/iotop.8 new/iotop-c-1.29/iotop.8 --- old/iotop-c-1.27/iotop.8 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/iotop.8 2025-05-07 00:18:44.000000000 +0200 @@ -249,8 +249,9 @@ Do not reverse GRAPH direction \- show most recent values on the left side .TP \fB\-q\fR, \fB\-\-quiet\fR -Suppress some lines of header (implies \-\-batch). This option can be specified -up to three times to remove header lines +Suppress headers before each run (implies \-\-batch). This option can be +specified up to three times to suppress the output of different header +lines: .RS .PD 0 .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/checks.c new/iotop-c-1.29/src/checks.c --- old/iotop-c-1.27/src/checks.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/checks.c 2025-05-07 00:18:44.000000000 +0200 @@ -17,7 +17,6 @@ #include <stdio.h> #include <unistd.h> #include <syscall.h> -#include <sys/stat.h> #include <sys/types.h> #include <linux/capability.h> @@ -26,9 +25,13 @@ int vm_event_counters=0; int root_or_netadm=0; int io_accounting=0; - struct stat s; uint64_t i,o; + if (!is_a_process(1)) { + printf("Looks like /proc is not mounted.\n"); + return 1; + } + if (geteuid()==0) root_or_netadm=1; else { @@ -59,11 +62,7 @@ return EACCES; } - if (stat("/proc/self/io",&s)) - perror("Error in stat"); - else - if (S_IFREG==(s.st_mode&S_IFMT)) - io_accounting=1; + io_accounting=is_a_file("/proc/self/io"); vm_event_counters=!get_vm_counters(&i,&o); if (!io_accounting||!vm_event_counters) { printf("Could not run iotop as some of the requirements are not met:\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/configfile.c new/iotop-c-1.29/src/configfile.c --- old/iotop-c-1.27/src/configfile.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/configfile.c 2025-05-07 00:18:44.000000000 +0200 @@ -13,6 +13,7 @@ #include "iotop.h" +#include <errno.h> #include <stdio.h> #include <limits.h> #include <stdlib.h> @@ -90,6 +91,8 @@ return -1; } rewind(cf); + if (errno) { + } ss=calloc(1,sz+1); if (!ss) { fclose(cf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/iotop.h new/iotop-c-1.29/src/iotop.h --- old/iotop-c-1.27/src/iotop.h 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/iotop.h 2025-05-07 00:18:44.000000000 +0200 @@ -30,7 +30,7 @@ #include "ucell.h" -#define VERSION "1.27" +#define VERSION "1.29" typedef enum { E_GR_IO, @@ -94,7 +94,9 @@ extern config_t config; extern params_t params; extern int maxpidlen; +extern unsigned taskstats_ver; +#define IOTOP_TASKSTATS_VERSION 15 #define HISTORY_POS 60 #define HISTORY_CNT (HISTORY_POS*2) @@ -219,6 +221,7 @@ inline int is_a_dir(const char *p); +inline int is_a_file(const char *p); inline int is_a_process(pid_t tid); inline double timediff_in_s(uint64_t sta,uint64_t end); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/main.c new/iotop-c-1.29/src/main.c --- old/iotop-c-1.27/src/main.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/main.c 2025-05-07 00:18:44.000000000 +0200 @@ -52,6 +52,7 @@ static const char *progname=NULL; int maxpidlen=5; +unsigned taskstats_ver=0; // 0=no warning, any version above the biggest known one will print a warning after exit config_t config={0}; params_t params={0}; @@ -61,7 +62,7 @@ view_loop v_loop_cb=view_curses_loop; inline void init_params(void) { - // initally params are zeroed; free the things possibly allocated on a second call + // initially params are zeroed; free the things possibly allocated on a second call if (params.search_str) free(params.search_str); if (params.search_regx_ok) @@ -144,7 +145,9 @@ " -g TYPE, --grtype=TYPE set graph data source (io, r, w, rw and sw)\n" " -R, --reverse-graph reverse GRAPH column direction\n" " --no-reverse-graph do not reverse GRAPH column direction\n" - " -q, --quiet suppress some lines of header (implies --batch)\n" + " -q, --quiet print column names only on the first run (implies --batch)\n" + " a second -q will also suppress the first run column names\n" + " a third -q will suppress the I/O summary\n" " -x, --dead-x show exited processes/threads with letter x\n" " --no-dead-x show exited processes/threads with background\n" " -e, --hide-exited hide exited processes\n" @@ -307,7 +310,6 @@ case 'P': case 'k': case 't': - case 'q': case 'c': case '1' ... '9': case 'x': @@ -319,6 +321,11 @@ case_opt: config.opts[(unsigned int)(strchr(str_opt,c)-str_opt)]=1; break; + case 'q': + config.f.quiet++; + if (config.f.quiet>3) + config.f.quiet=3; + break; case 'n': params.iter=atoi(optarg); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/taskstats-v14.h new/iotop-c-1.29/src/taskstats-v14.h --- old/iotop-c-1.27/src/taskstats-v14.h 1970-01-01 01:00:00.000000000 +0100 +++ new/iotop-c-1.29/src/taskstats-v14.h 2025-05-07 00:18:44.000000000 +0200 @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: LGPL-2.1 WITH Linux-syscall-note */ +/* taskstats.h - exporting per-task statistics + * + * Copyright (C) Shailabh Nagar, IBM Corp. 2006 + * (C) Balbir Singh, IBM Corp. 2006 + * (C) Jay Lan, SGI, 2006 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef ___TASKSTATS_V14_H___ +#define ___TASKSTATS_V14_H___ + +#include <linux/types.h> + +//#define TASKSTATS_VERSION 14 + +struct taskstats_v14 { + + /* The version number of this struct. This field is always set to + * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>. + * Each time the struct is changed, the value should be incremented. + */ + __u16 version; + __u32 ac_exitcode; /* Exit status */ + + /* The accounting flags of a task as defined in <linux/acct.h> + * Defined values are AFORK, ASU, ACOMPAT, ACORE, AXSIG, and AGROUP. + * (AGROUP since version 12). + */ + __u8 ac_flag; /* Record flags */ + __u8 ac_nice; /* task_nice */ + + /* Delay accounting fields start + * + * All values, until comment "Delay accounting fields end" are + * available only if delay accounting is enabled, even though the last + * few fields are not delays + * + * xxx_count is the number of delay values recorded + * xxx_delay_total is the corresponding cumulative delay in nanoseconds + * + * xxx_delay_total wraps around to zero on overflow + * xxx_count incremented regardless of overflow + */ + + /* Delay waiting for cpu, while runnable + * count, delay_total NOT updated atomically + */ + __u64 cpu_count __attribute__((aligned(8))); + __u64 cpu_delay_total; + + /* Following four fields atomically updated using task->delays->lock */ + + /* Delay waiting for synchronous block I/O to complete + * does not account for delays in I/O submission + */ + __u64 blkio_count; + __u64 blkio_delay_total; + + /* Delay waiting for page fault I/O (swap in only) */ + __u64 swapin_count; + __u64 swapin_delay_total; + + /* cpu "wall-clock" running time + * On some architectures, value will adjust for cpu time stolen + * from the kernel in involuntary waits due to virtualization. + * Value is cumulative, in nanoseconds, without a corresponding count + * and wraps around to zero silently on overflow + */ + __u64 cpu_run_real_total; + + /* cpu "virtual" running time + * Uses time intervals seen by the kernel i.e. no adjustment + * for kernel's involuntary waits due to virtualization. + * Value is cumulative, in nanoseconds, without a corresponding count + * and wraps around to zero silently on overflow + */ + __u64 cpu_run_virtual_total; + /* Delay accounting fields end */ + /* version 1 ends here */ + + /* Basic Accounting Fields start */ + char ac_comm[TS_COMM_LEN]; /* Command name */ + __u8 ac_sched __attribute__((aligned(8))); + /* Scheduling discipline */ + __u8 ac_pad[3]; + __u32 ac_uid __attribute__((aligned(8))); + /* User ID */ + __u32 ac_gid; /* Group ID */ + __u32 ac_pid; /* Process ID */ + __u32 ac_ppid; /* Parent process ID */ + /* __u32 range means times from 1970 to 2106 */ + __u32 ac_btime; /* Begin time [sec since 1970] */ + __u64 ac_etime __attribute__((aligned(8))); + /* Elapsed time [usec] */ + __u64 ac_utime; /* User CPU time [usec] */ + __u64 ac_stime; /* SYstem CPU time [usec] */ + __u64 ac_minflt; /* Minor Page Fault Count */ + __u64 ac_majflt; /* Major Page Fault Count */ + /* Basic Accounting Fields end */ + + /* Extended accounting fields start */ + /* Accumulated RSS usage in duration of a task, in MBytes-usecs. + * The current rss usage is added to this counter every time + * a tick is charged to a task's system time. So, at the end we + * will have memory usage multiplied by system time. Thus an + * average usage per system time unit can be calculated. + */ + __u64 coremem; /* accumulated RSS usage in MB-usec */ + /* Accumulated virtual memory usage in duration of a task. + * Same as acct_rss_mem1 above except that we keep track of VM usage. + */ + __u64 virtmem; /* accumulated VM usage in MB-usec */ + + /* High watermark of RSS and virtual memory usage in duration of + * a task, in KBytes. + */ + __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ + __u64 hiwater_vm; /* High-water VM usage, in KB */ + + /* The following four fields are I/O statistics of a task. */ + __u64 read_char; /* bytes read */ + __u64 write_char; /* bytes written */ + __u64 read_syscalls; /* read syscalls */ + __u64 write_syscalls; /* write syscalls */ + /* Extended accounting fields end */ + +//#define TASKSTATS_HAS_IO_ACCOUNTING + /* Per-task storage I/O accounting starts */ + __u64 read_bytes; /* bytes of read I/O */ + __u64 write_bytes; /* bytes of write I/O */ + __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ + + __u64 nvcsw; /* voluntary_ctxt_switches */ + __u64 nivcsw; /* nonvoluntary_ctxt_switches */ + + /* time accounting for SMT machines */ + __u64 ac_utimescaled; /* utime scaled on frequency etc */ + __u64 ac_stimescaled; /* stime scaled on frequency etc */ + __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ + + /* Delay waiting for memory reclaim */ + __u64 freepages_count; + __u64 freepages_delay_total; + + /* Delay waiting for thrashing page */ + __u64 thrashing_count; + __u64 thrashing_delay_total; + + /* v10: 64-bit btime to avoid overflow */ + __u64 ac_btime64; /* 64-bit begin time */ + + /* v11: Delay waiting for memory compact */ + __u64 compact_count; + __u64 compact_delay_total; + + /* v12 begin */ + __u32 ac_tgid; /* thread group ID */ + /* Thread group walltime up to now. This is total process walltime if + * AGROUP flag is set. + */ + __u64 ac_tgetime __attribute__((aligned(8))); + /* Lightweight information to identify process binary files. + * This leaves userspace to match this to a file system path, using + * MAJOR() and MINOR() macros to identify a device and mount point, + * the inode to identify the executable file. This is /proc/self/exe + * at the end, so matching the most recent exec(). Values are zero + * for kernel threads. + */ + __u64 ac_exe_dev; /* program binary device ID */ + __u64 ac_exe_inode; /* program binary inode number */ + /* v12 end */ + + /* v13: Delay waiting for write-protect copy */ + __u64 wpcopy_count; + __u64 wpcopy_delay_total; + + /* v14: Delay waiting for IRQ/SOFTIRQ */ + __u64 irq_count; + __u64 irq_delay_total; +}; + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/taskstats-v15.h new/iotop-c-1.29/src/taskstats-v15.h --- old/iotop-c-1.27/src/taskstats-v15.h 1970-01-01 01:00:00.000000000 +0100 +++ new/iotop-c-1.29/src/taskstats-v15.h 2025-05-07 00:18:44.000000000 +0200 @@ -0,0 +1,207 @@ +/* SPDX-License-Identifier: LGPL-2.1 WITH Linux-syscall-note */ +/* taskstats.h - exporting per-task statistics + * + * Copyright (C) Shailabh Nagar, IBM Corp. 2006 + * (C) Balbir Singh, IBM Corp. 2006 + * (C) Jay Lan, SGI, 2006 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef ___TASKSTATS_V15_H___ +#define ___TASKSTATS_V15_H___ + +#include <linux/types.h> + +//#define TASKSTATS_VERSION 15 + +struct taskstats_v15 { + + /* The version number of this struct. This field is always set to + * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>. + * Each time the struct is changed, the value should be incremented. + */ + __u16 version; + __u32 ac_exitcode; /* Exit status */ + + /* The accounting flags of a task as defined in <linux/acct.h> + * Defined values are AFORK, ASU, ACOMPAT, ACORE, AXSIG, and AGROUP. + * (AGROUP since version 12). + */ + __u8 ac_flag; /* Record flags */ + __u8 ac_nice; /* task_nice */ + + /* Delay accounting fields start + * + * All values, until comment "Delay accounting fields end" are + * available only if delay accounting is enabled, even though the last + * few fields are not delays + * + * xxx_count is the number of delay values recorded + * xxx_delay_total is the corresponding cumulative delay in nanoseconds + * + * xxx_delay_total wraps around to zero on overflow + * xxx_count incremented regardless of overflow + */ + + /* Delay waiting for cpu, while runnable + * count, delay_total NOT updated atomically + */ + __u64 cpu_count __attribute__((aligned(8))); + __u64 cpu_delay_total; + __u64 cpu_delay_max; + __u64 cpu_delay_min; + + /* Following four fields atomically updated using task->delays->lock */ + + /* Delay waiting for synchronous block I/O to complete + * does not account for delays in I/O submission + */ + __u64 blkio_count; + __u64 blkio_delay_total; + __u64 blkio_delay_max; + __u64 blkio_delay_min; + + /* Delay waiting for page fault I/O (swap in only) */ + __u64 swapin_count; + __u64 swapin_delay_total; + __u64 swapin_delay_max; + __u64 swapin_delay_min; + + /* cpu "wall-clock" running time + * On some architectures, value will adjust for cpu time stolen + * from the kernel in involuntary waits due to virtualization. + * Value is cumulative, in nanoseconds, without a corresponding count + * and wraps around to zero silently on overflow + */ + __u64 cpu_run_real_total; + + /* cpu "virtual" running time + * Uses time intervals seen by the kernel i.e. no adjustment + * for kernel's involuntary waits due to virtualization. + * Value is cumulative, in nanoseconds, without a corresponding count + * and wraps around to zero silently on overflow + */ + __u64 cpu_run_virtual_total; + /* Delay accounting fields end */ + /* version 1 ends here */ + + /* Basic Accounting Fields start */ + char ac_comm[TS_COMM_LEN]; /* Command name */ + __u8 ac_sched __attribute__((aligned(8))); + /* Scheduling discipline */ + __u8 ac_pad[3]; + __u32 ac_uid __attribute__((aligned(8))); + /* User ID */ + __u32 ac_gid; /* Group ID */ + __u32 ac_pid; /* Process ID */ + __u32 ac_ppid; /* Parent process ID */ + /* __u32 range means times from 1970 to 2106 */ + __u32 ac_btime; /* Begin time [sec since 1970] */ + __u64 ac_etime __attribute__((aligned(8))); + /* Elapsed time [usec] */ + __u64 ac_utime; /* User CPU time [usec] */ + __u64 ac_stime; /* SYstem CPU time [usec] */ + __u64 ac_minflt; /* Minor Page Fault Count */ + __u64 ac_majflt; /* Major Page Fault Count */ + /* Basic Accounting Fields end */ + + /* Extended accounting fields start */ + /* Accumulated RSS usage in duration of a task, in MBytes-usecs. + * The current rss usage is added to this counter every time + * a tick is charged to a task's system time. So, at the end we + * will have memory usage multiplied by system time. Thus an + * average usage per system time unit can be calculated. + */ + __u64 coremem; /* accumulated RSS usage in MB-usec */ + /* Accumulated virtual memory usage in duration of a task. + * Same as acct_rss_mem1 above except that we keep track of VM usage. + */ + __u64 virtmem; /* accumulated VM usage in MB-usec */ + + /* High watermark of RSS and virtual memory usage in duration of + * a task, in KBytes. + */ + __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ + __u64 hiwater_vm; /* High-water VM usage, in KB */ + + /* The following four fields are I/O statistics of a task. */ + __u64 read_char; /* bytes read */ + __u64 write_char; /* bytes written */ + __u64 read_syscalls; /* read syscalls */ + __u64 write_syscalls; /* write syscalls */ + /* Extended accounting fields end */ + +//#define TASKSTATS_HAS_IO_ACCOUNTING + /* Per-task storage I/O accounting starts */ + __u64 read_bytes; /* bytes of read I/O */ + __u64 write_bytes; /* bytes of write I/O */ + __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ + + __u64 nvcsw; /* voluntary_ctxt_switches */ + __u64 nivcsw; /* nonvoluntary_ctxt_switches */ + + /* time accounting for SMT machines */ + __u64 ac_utimescaled; /* utime scaled on frequency etc */ + __u64 ac_stimescaled; /* stime scaled on frequency etc */ + __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ + + /* Delay waiting for memory reclaim */ + __u64 freepages_count; + __u64 freepages_delay_total; + __u64 freepages_delay_max; + __u64 freepages_delay_min; + + /* Delay waiting for thrashing page */ + __u64 thrashing_count; + __u64 thrashing_delay_total; + __u64 thrashing_delay_max; + __u64 thrashing_delay_min; + + /* v10: 64-bit btime to avoid overflow */ + __u64 ac_btime64; /* 64-bit begin time */ + + /* v11: Delay waiting for memory compact */ + __u64 compact_count; + __u64 compact_delay_total; + __u64 compact_delay_max; + __u64 compact_delay_min; + + /* v12 begin */ + __u32 ac_tgid; /* thread group ID */ + /* Thread group walltime up to now. This is total process walltime if + * AGROUP flag is set. + */ + __u64 ac_tgetime __attribute__((aligned(8))); + /* Lightweight information to identify process binary files. + * This leaves userspace to match this to a file system path, using + * MAJOR() and MINOR() macros to identify a device and mount point, + * the inode to identify the executable file. This is /proc/self/exe + * at the end, so matching the most recent exec(). Values are zero + * for kernel threads. + */ + __u64 ac_exe_dev; /* program binary device ID */ + __u64 ac_exe_inode; /* program binary inode number */ + /* v12 end */ + + /* v13: Delay waiting for write-protect copy */ + __u64 wpcopy_count; + __u64 wpcopy_delay_total; + __u64 wpcopy_delay_max; + __u64 wpcopy_delay_min; + + /* v14: Delay waiting for IRQ/SOFTIRQ */ + __u64 irq_count; + __u64 irq_delay_total; + __u64 irq_delay_max; + __u64 irq_delay_min; + /* v15: add Delay max */ +}; + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/utils.c new/iotop-c-1.29/src/utils.c --- old/iotop-c-1.27/src/utils.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/utils.c 2025-05-07 00:18:44.000000000 +0200 @@ -323,10 +323,18 @@ return d; } +inline int is_a_file(const char *p) { + struct stat st; + + if (lstat(p,&st)) + return 0; + return (st.st_mode&S_IFMT)==S_IFREG; +} + inline int is_a_dir(const char *p) { struct stat st; - if (stat(p,&st)) + if (lstat(p,&st)) return 0; return (st.st_mode&S_IFMT)==S_IFDIR; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/view_batch.c new/iotop-c-1.29/src/view_batch.c --- old/iotop-c-1.27/src/view_batch.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/view_batch.c 2025-05-07 00:18:44.000000000 +0200 @@ -25,6 +25,7 @@ char str_a_read[4],str_a_write[4]; double total_read,total_write; char str_read[4],str_write[4]; + static int firsthdr=1; int i; calc_total(cs,&total_read,&total_write); @@ -35,7 +36,7 @@ humanize_val(&total_a_read,str_a_read,0); humanize_val(&total_a_write,str_a_write,0); - if (!config.f.quiet) { + if (config.f.quiet<3) { printf(HEADER1_FORMAT,total_read,str_read,"",total_write,str_write,""); if (config.f.timestamp) { @@ -47,6 +48,10 @@ printf(HEADER2_FORMAT,total_a_read,str_a_read,"",total_a_write,str_a_write,""); printf("\n"); + } + + if (config.f.quiet==0||(config.f.quiet==1&&firsthdr)) { + firsthdr=0; printf("%6s %4s %8s %11s %11s %6s %6s %s\n",config.f.processes?"PID":"TID","PRIO","USER","DISK READ","DISK WRITE","SWAPIN","IO","COMMAND"); } @@ -103,7 +108,7 @@ inline void view_batch_init(void) { if (!read_task_delayacct()) - printf("Warning: task_delayacct is 0, enable by: echo 1 > /proc/sys/kernel/task_delayacct\n"); + fprintf(stderr,"Warning: task_delayacct is 0, enable by: echo 1 > /proc/sys/kernel/task_delayacct\n"); } inline void view_batch_fini(void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/view_curses.c new/iotop-c-1.29/src/view_curses.c --- old/iotop-c-1.27/src/view_curses.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/view_curses.c 2025-05-07 00:18:44.000000000 +0200 @@ -2603,6 +2603,13 @@ "\tto restore it to its previous value and save some CPU cycles.\n" ); } + if (taskstats_ver) + printf( + "WARNING:\n" + "\tThis kernel provides struct taskstats with version %u.\n" + "\tThat may not be compatible with the currently supported version %u.\n", + taskstats_ver,IOTOP_TASKSTATS_VERSION + ); } inline void view_curses_loop(void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iotop-c-1.27/src/xxxid_info.c new/iotop-c-1.29/src/xxxid_info.c --- old/iotop-c-1.27/src/xxxid_info.c 2025-01-13 11:40:50.000000000 +0100 +++ new/iotop-c-1.29/src/xxxid_info.c 2025-05-07 00:18:44.000000000 +0200 @@ -25,6 +25,13 @@ #include <linux/taskstats.h> #include <linux/genetlink.h> +// Recent Linux kernel broke the backwards compatibility in struct taskstats, +// rendering the kernel headers useless and forcing userland to make hacks +// like the one below... :( + +#include "taskstats-v14.h" +#include "taskstats-v15.h" + /* * Generic macros for dealing with netlink sockets. Might be duplicated * elsewhere @@ -185,14 +192,29 @@ while (len2<aggr_len) { if (na->nla_type==TASKSTATS_TYPE_STATS) { struct taskstats *ts=NLA_DATA(na); + struct taskstats_v14 *t14=NLA_DATA(na); + struct taskstats_v15 *t15=NLA_DATA(na); - #define COPY(field) { stats->field = ts->field; } - COPY(read_bytes); - COPY(write_bytes); - COPY(swapin_delay_total); - COPY(blkio_delay_total); - #undef COPY - stats->euid=ts->ac_uid; + // add a compile time check to raise awareness + #if TASKSTATS_VERSION > IOTOP_TASKSTATS_VERSION + #warning Current kernel implements newer struct taskstats, maybe we need a fix for that too + #endif + + if (ts->version<15) { // use v14 for 14 and below + stats->read_bytes=t14->read_bytes; + stats->write_bytes=t14->write_bytes; + stats->swapin_delay_total=t14->swapin_delay_total; + stats->blkio_delay_total=t14->blkio_delay_total; + stats->euid=t14->ac_uid; + } else { + stats->read_bytes=t15->read_bytes; + stats->write_bytes=t15->write_bytes; + stats->swapin_delay_total=t15->swapin_delay_total; + stats->blkio_delay_total=t15->blkio_delay_total; + stats->euid=t15->ac_uid; + if (ts->version>IOTOP_TASKSTATS_VERSION) // print a warning about running on a kernel with maybe incompatible struct taskstats + taskstats_ver=ts->version; + } } len2+=NLA_ALIGN(na->nla_len); na=(struct nlattr *)((char *)na+len2);