Package Details: netatop 3.2.2-1

Git Clone URL: https://aur.archlinux.org/netatop.git (read-only, click to copy)
Package Base: netatop
Description: Atop network kernel module, enables network statistics in atop
Upstream URL: http://www.atoptool.nl/
Keywords: atop kernel module netatop
Licenses: GPL
Groups: modules
Submitter: Spider.007
Maintainer: batot
Last Packager: batot
Votes: 27
Popularity: 0.000007
First Submitted: 2013-02-16 11:58 (UTC)
Last Updated: 2025-04-22 23:41 (UTC)

Dependencies (4)

Required by (0)

Sources (1)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

3ndymion commented on 2020-04-09 22:40 (UTC)

Thanks for reporting. I noticed it too, but I've been very busy. If the developer got your message, it will probably take him some time to find the changes that were made in the kernel again. As long as you mentioned the same things you mentioned here, then he'll probably know what to look for.

frankspace commented on 2020-04-09 15:23 (UTC) (edited on 2020-04-09 20:12 (UTC) by frankspace)

It seems that this is broken again with kernel 5.6. I am not entirely sure why, but it seems to have something to do with getboottime or getboottime64, maybe involving changes in timekeeping.h or "struct timespc"... but to be honest, I'm nowhere near clever enough to figure out exactly what changed.

Edit: I have sent a message to the maintainer.

Spider.007 commented on 2020-03-04 17:58 (UTC)

@bartus why are you flagging this package out of date?

3ndymion commented on 2020-03-03 15:43 (UTC)

Please Note: The maintainer of netatop on the atop website has responded to me. Netatop v3.0 is now available. I already tested it with this makepkg, & it works perfectly fine now. He also added a SystemD service file which I have not looked into yet.

Please test it all & see. This should be able to be implemented without any patches now.

bartus commented on 2020-02-28 14:56 (UTC)

Patch for kernel>=5.5

git am < <(curl -s http://ix.io/1DAW)

valandil commented on 2020-02-25 02:06 (UTC) (edited on 2020-02-25 02:06 (UTC) by valandil)

Hi,

I also did a bit of digging, and it seems that the real_start_time was renamed to start_boottime in v5.5.0 of the kernel. You can verify that either by running

git diff v5.4.15-arch1:include/linux/sched.h v5.5-arch1:include/linux/sched.h

on the Arch linux kernel repo, or just check the change on the kernel repo itself: https://github.com/torvalds/linux/commit/cf25e24db61cc9df42c47485a2ec2bff4e9a3692.

Here are some links to a fixed PKGBUILD with a patch.

Contents of PKGBUILD: https://hastebin.com/cakewikuqi.bash

Contents of the patch: https://hastebin.com/nomoxunati.diff

Cheers,

3ndymion commented on 2020-02-13 20:03 (UTC)

Oh, that would certainly make it much easier. Thanks for that.

frankspace commented on 2020-02-13 03:05 (UTC)

3ndymion, that's nice detective work, but there's a vastly easier way to implement the "real_start_time" to "start_time" fix. Just add the following line to build() before invoking make:

sed -ri 's|real_start_time|start_time|g' module/netatop.c

And that'll handle the editing without needing to tamper with the source tarball.

3ndymion commented on 2020-02-11 13:02 (UTC)

As a bonus, you can have makepkg insert the kernel module immediately instead of having to reboot yet again to make it work. Edit the file depmod.install & add "modprobe netatop ;" to each line.

post_install(){ depmod -a ; modprobe netatop ; }
post_upgrade(){ depmod -a ; modprobe netatop ; }

That way, when you build the file, modprobe will insert the kernel module automatically, & netatop will work without having to reboot again.

3ndymion commented on 2020-02-11 12:40 (UTC) (edited on 2020-02-11 12:54 (UTC) by 3ndymion)

Hello again. The module fails to build as of kernel version 5.5.1. This time, the problem is in the source code. I sent a message to the maintainer on the website, though I'm not totally sure if it actually went through. In the meantime, the problem can be fixed temporarily. Here's how to do it:

PROBLEM

It seems that an old variable named "real_start_time" has been renamed "start_time".

make[2]: Entering directory '/usr/lib/modules/5.5.2-arch2-2/build'
  CC [M]  /tmp/makepkg/netatop/src/netatop-2.0/module/netatop.o
/tmp/makepkg/netatop/src/netatop-2.0/module/netatop.c: In function ‘get_taskinfo’:
/tmp/makepkg/netatop/src/netatop-2.0/module/netatop.c:969:33: error: ‘struct task_struct’ has no member named ‘real_start_time’; did you mean ‘start_time’?
969 |  tip->btime = div_u64((current->real_start_time +
  |                                 ^~~~~~~~~~~~~~~
  |                                 start_time

SOLUTION

We must change the variable name in the source code. We will unzip the source directory, change the variable name, then zip the source directory again. Finally, we will get the sha256 hash of the new zip file & inform makepkg to use that for verification.

-Unzip the source code.
   tar -xvf netatop-2.0.tar.gz
-Move the zipped file netatop-2.0.tar.gz to the trash to get it out of the way.
-Go into netatop-2.0/module/ and open the file netatop.c for editing.
-Find 4 instances of "real_start_time" between lines 969 - 976.
-Change them to "start_time", then save the file & close it.
-Go back to the folder where netatop-2.0 is located.
-Zip the netatop-2.0 source code folder again with tar using gzip compression.
   tar -czvf netatop-2.0.tar.gz netatop-2.0
-Get the sha256 hash of the new zipped file.
   sha256sum netatop-2.0.tar.gz
-Copy the long hash number, then go to wherever you have the netatop PKGBUILD file & open it for editing.
-Find the line that says sha256sums, & replace the old hash number with the new one.  Save & close.

Building the file should work now.

makepkg -sic

Edit: Trying to get markdown formatting to work.