Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Sep 2023 08:56:32 +0100
From:      Graham Perrin <grahamperrin@gmail.com>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        FreeBSD-CURRENT <freebsd-current@freebsd.org>
Subject:   Re: kernel 100% CPU
Message-ID:  <79114b6f-9fe1-2e76-55be-a27cf8c178bf@gmail.com>
In-Reply-To: <CAGudoHEhNG2e2J7Cb2w0EKZ7p_cdq0hie_s67AHCj7x8hfw8SA@mail.gmail.com>
References:  <95e9f65b-58c4-ef3a-a5d1-b794179e4252@gmail.com> <CAGudoHG%2B4wT-MCP=zE4VqdJYJwTKSLf8GfARvQbGwKZw%2Bz8F_g@mail.gmail.com> <d2e5951a-7c6c-f450-eacc-d8e4f6446118@gmail.com> <CAGudoHEhNG2e2J7Cb2w0EKZ7p_cdq0hie_s67AHCj7x8hfw8SA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 02/09/2023 18:31, Mateusz Guzik wrote:

> Looks like you have a lot of unrelated traffic in there.
>
> Run this script:
> #pragma D option dynvarsize=32m
>
> profile:::profile-997
> /execname == "find"/
> {
>          @oncpu[stack(), "oncpu"] = count();
> }
>
> /*
>   * The p_flag & 0x4 test filters out kernel threads.
>   */
>
> sched:::off-cpu
> /execname == "find"/
> {
>          self->ts = timestamp;
> }
>
> sched:::on-cpu
> /self->ts/
> {
>          @offcpu[stack(30), "offcpu"] = sum(timestamp - self->ts);
>          self->ts = 0;
> }
>
> dtrace:::END
> {
>          normalize(@offcpu, 1000000);
>          printa("%k\n%s\n%@d\n\n", @offcpu);
>          printa("%k\n%s\n%@d\n\n", @oncpu);
> }
>
> dtrace -s script.d -o out


# pwd
/home/grahamperrin/Documents/IT/BSD/FreeBSD/kernel-cpu
# ./2023-09-02-18-31.sh
./2023-09-02-18-31.sh: profile:::profile-997: not found
./2023-09-02-18-31.sh: /execname: not found
./2023-09-02-18-31.sh: 6: Syntax error: "(" unexpected (expecting "}")
# whoami
root
# echo $
$
# echo $0
sh
# echo $SHELL
/bin/csh
# exit
root@mowa219-gjp4-8570p-freebsd:/home/grahamperrin/Documents/IT/BSD/FreeBSD/kernel-cpu 
#




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?79114b6f-9fe1-2e76-55be-a27cf8c178bf>