Re: canbusload and canfd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sven!

On 21.01.25 13:14, Sven Schuchmann wrote:
Hi,
I am trying to use the canbusload utility for the first time - ashes on my head :-)

I have an canfd interface configured like this with some traffic:
$ ip -det a s canfd0
3: canfd0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP group default qlen 4096
     link/can  promiscuity 0  allmulti 0 minmtu 0 maxmtu 0
     can <BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 500
           bitrate 500000 sample-point 0.800
           tq 25 prop-seg 31 phase-seg1 32 phase-seg2 16 sjw 3 brp 1
           mcp251xfd: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..256 brp_inc 1
           dbitrate 2000000 dsample-point 0.700
           dtq 25 dprop-seg 6 dphase-seg1 7 dphase-seg2 6 dsjw 4 dbrp 1
           mcp251xfd: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..256 dbrp_inc 1
           clock 40000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 parentbus spi parentdev spi0.0

If I do "canbusload canfd0@500000" the output is nothing.
If I do "canbusload canfd0@500000 -r" the output is "canfd0@500000     0       0      0   0%"

Do I need to give a special bitrate for canfd to work?

Yes, of course!
Without the data bitrate it is hard to measure the CAN FD busload ;-)

Try

canbusload -?

or just without any options to get the help text:

$ canbusload -?
canbusload - monitor CAN bus load.

Usage: canbusload [options] <CAN interface>+
  (use CTRL-C to terminate canbusload)

Options:
         -t  (show current time on the first line)
         -c  (colorize lines)
         -b  (show bargraph in 5% resolution)
         -r  (redraw the terminal - similar to top)
         -i  (ignore bitstuffing in bandwidth calculation)
         -e  (exact calculation of stuffed bits)

Up to 16 CAN interfaces with mandatory bitrate can be specified on the
commandline in the form: <ifname>@<bitrate>[,<dbitrate>]

The bitrate is mandatory as it is needed to know the CAN bus bitrate to
calculate the bus load percentage based on the received CAN frames.
Due to the bitstuffing estimation the calculated busload may exceed 100%.
For each given interface the data is presented in one line which contains:

(interface) (received CAN frames) (used bits total) (used bits for payload)

Examples:

user$> canbusload can0@100000 can1@500000 can2@500000 can3@500000 -r -t -b -c

canbusload 2014-02-01 21:13:16 (worst case bitstuffing)
 can0@100000   805   74491  36656  74% |XXXXXXXXXXXXXX......|
 can1@500000   796   75140  37728  15% |XXX.................|
 can2@500000     0       0      0   0% |....................|
 can3@500000    47    4633   2424   0% |....................|


So it is e.g.
canbusload canfd0@500000,2000000

Best regards,
Oliver





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux