can-utils icon indicating copy to clipboard operation
can-utils copied to clipboard

Cansniffer freezing for about 5 seconds when filtering ID's using bitmask after runtime

Open mitchdetailed opened this issue 3 years ago • 8 comments

i've recently noticed that cansniffer is freezing for a few seconds after adding or removing frames using a bitmask. (+500700) or (-1237FF), etc.

mitchdetailed avatar Jul 13 '21 20:07 mitchdetailed

Hey @mitchdetailed,

can you give me details:

  • Which kernel version are you using?
  • Which can-utils version are you using?
  • What are the steps to reproduce the issue on the command line?

regards, Marc

marckleinebudde avatar Jul 14 '21 07:07 marckleinebudde

Hm @mitchdetailed - this issue is open for a while now.

Can you tell us the can-utils version, Marc was asking for? Did you get the can-utils via Debian/Ubuntu package (which is unfortunately pretty outdated) or did you build it on your own from this repository?

hartkopp avatar May 04 '22 17:05 hartkopp

just the common package using sudo apt-get. i can confirm that it still is an issue when using masks. youtube video link will be supplied shortly

On Wed, May 4, 2022, 1:17 PM Oliver Hartkopp @.***> wrote:

Hm @mitchdetailed https://github.com/mitchdetailed - this issue is open for a while now.

Can you tell us the can-utils version, Marc was asking for? Did you get the can-utils via Debian/Ubuntu package (which is unfortunately pretty outdated) or did you build it on your own from this repository?

— Reply to this email directly, view it on GitHub https://github.com/linux-can/can-utils/issues/306#issuecomment-1117605559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI62NLWSLVSXCYKCWLT7YADVIKWLNANCNFSM5AKBKMDQ . You are receiving this because you were mentioned.Message ID: @.***>

mitchdetailed avatar May 18 '22 17:05 mitchdetailed

https://youtu.be/rJkoJQktLWs

On Wed, May 18, 2022 at 12:55 PM Mitch Minton @.***> wrote:

just the common package using sudo apt-get. i can confirm that it still is an issue when using masks. youtube video link will be supplied shortly

On Wed, May 4, 2022, 1:17 PM Oliver Hartkopp @.***> wrote:

Hm @mitchdetailed https://github.com/mitchdetailed - this issue is open for a while now.

Can you tell us the can-utils version, Marc was asking for? Did you get the can-utils via Debian/Ubuntu package (which is unfortunately pretty outdated) or did you build it on your own from this repository?

— Reply to this email directly, view it on GitHub https://github.com/linux-can/can-utils/issues/306#issuecomment-1117605559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI62NLWSLVSXCYKCWLT7YADVIKWLNANCNFSM5AKBKMDQ . You are receiving this because you were mentioned.Message ID: @.***>

-- Minton Performance 615-977-9787

mitchdetailed avatar May 18 '22 18:05 mitchdetailed

Thanks for the video! Never seen such behavior!

So still the questions from Marc stay open:

What is you Linux kernel version? (output of uname -a) What is your can-utils version? (output of dpkg -l can-utils)

hartkopp avatar May 18 '22 19:05 hartkopp

Hi @mitchdetailed ,

I think I found the problem.

Since this commit https://github.com/torvalds/linux/commit/d5f9023fa61ee8b94f37a93f08e94b136cf1e463 the removal of CAN_BCM jobs is delayed to remove some data structures in a safe way. I've never seen this effect but with the use of the 'old' BCM-based cansniffer (which is now only available here https://github.com/linux-can/can-tests/blob/master/bcm/cansniffer.c) the delay of removing 2048 BCM jobs can be shown easily.

So this safety fix of the BCM obviously needs to be revisited in terms of performance :-/

To fix the problem for you:

  1. remove the out-dated can-utils package from your system with apt remove --purge can-utils
  2. clone the latest can-utils from this repository git clone https://github.com/linux-can/can-utils.git
  3. cd can-utils
  4. make
  5. sudo make install

The new cansniffer does not use the CAN_BCM but the CAN_RAW sockets (and supports 29bit CAN IDs).

hartkopp avatar May 19 '22 19:05 hartkopp

in case nobody has told you today, you're awesome Oliver!

On Thu, May 19, 2022, 2:54 PM Oliver Hartkopp @.***> wrote:

Hi @mitchdetailed https://github.com/mitchdetailed ,

I think I found the problem.

Since this commit @.*** https://github.com/torvalds/linux/commit/d5f9023fa61ee8b94f37a93f08e94b136cf1e463 the removal of CAN_BCM jobs is delayed to remove some data structures in a safe way. I've never seen this effect but with the use of the 'old' BCM-based cansniffer which is now only available here https://github.com/linux-can/can-tests/blob/master/bcm/cansniffer.c the delay of removing 2048 BCM jobs can be shown easily.

So this safety fix of the BCM obviously needs to be revisited in term of performance :-/

To fix the problem for you:

  1. remove the out-dated can-utils package from your system with apt remove --purge can-utils
  2. clone the latest can-utils from this repository git clone https://github.com/linux-can/can-utils.git
  3. cd can-utils
  4. make
  5. sudo make install

The new cansniffer does not use the CAN_BCM but the CAN_RAW sockets (and supports 29bit CAN IDs).

— Reply to this email directly, view it on GitHub https://github.com/linux-can/can-utils/issues/306#issuecomment-1132137918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI62NLRQFNRA572RY5LRL3DVK2L6VANCNFSM5AKBKMDQ . You are receiving this because you were mentioned.Message ID: @.***>

mitchdetailed avatar May 19 '22 20:05 mitchdetailed

in case nobody has told you today, you're awesome Oliver!

Thanks Mitch!

But as you can see, improvement can only happen when people like you use that stuff and provide valuable bug reports (including your eye-opening video!). So I can give that 'thank you' back to Tennessee !!

hartkopp avatar May 19 '22 20:05 hartkopp