This patch changes libc's _mcleanup() function so it serializes gmon
profiling data with utrace(2). gprof(1) is also modified: it can now
deserialize that profiling data from a ktrace(2) file.
Only apply this patch if you are testing the profclock() patch.
Index: lib/libc/gmon/g
ut then I
> noticed that "good" and "bad" data can be gathered for different run
> of the same executable.
>
> Compare for example
>
> https://ftp.omarpolo.com/tmp/pack-got/profile.got-read-pack.52583.png
> (bad)
>
> and
>
> https://ftp.omarp
Hi Sebastien,
Super super interesting stuff!
On Tue, Apr 11, 2023 at 09:28:31AM +0200, Sebastien Marie wrote:
> ## compile and collect profil information (-tu option on ktrace is optional)
> $ cc -static -pg test.c
> $ ktrace -di -tu ./a.out
>
> ## get gmon.out file
> $ kdump -u gmon.out | unvis
On 2023/04/11 09:28:31 +0200, Sebastien Marie wrote:
> Hi,
>
> After otto@ work on mallocdump using utrace(2), I started to look again at
> profiling (see moncontrol(2)).
>
> The current implementation tries to write a gmon.out file at program exit(3)
> time, which
n be compiled with MALLOC_STATS
> > > > > > > > > defined. If run
> > > > > > > > > with option D it dumps its state to a malloc.out file at
> > > > > > > > > exit. This
> > > > >
ate to a malloc.out file at exit.
> > > > > > > > This
> > > > > > > > state can be used to find leaks amongst other things.
> > > > > > > >
> > > > > > > > This is not ideal for pledged processes, as
compiled with MALLOC_STATS defined. If
> > > > > > > run
> > > > > > > with option D it dumps its state to a malloc.out file at exit.
> > > > > > > This
> > > > > > > state can be used to find leaks amongst other thing
Sebastien Marie wrote:
> For post-execution gmon.out extraction, an helper might be needed: ktrace.out
> could contain multiple gmon.out files.
kdump can be taught to generate the right file.
Hi,
After otto@ work on mallocdump using utrace(2), I started to look again at
profiling (see moncontrol(2)).
The current implementation tries to write a gmon.out file at program exit(3)
time, which isn't compatible with pledge(2) or unveil(2).
This diff changes the way the runtime prof
r 2023 10:16:11 -
> @@ -284,10 +284,13 @@ If it has been corrupted, the process is
> .It Cm D
> .Dq Dump .
> .Fn malloc
> -will dump statistics to the file
> -.Pa ./malloc.out ,
> -if it already exists,
> +will dump statistics using
> +.Xr utrace 2
> at exit.
&
is
> > > > > > state can be used to find leaks amongst other things.
> > > > > >
> > > > > > This is not ideal for pledged processes, as they often have no way
> > > > > > to
> > > > > > write files.
> >
On Sun, Apr 09, 2023 at 10:08:25AM +0200, Claudio Jeker wrote:
> On Sun, Apr 09, 2023 at 09:15:12AM +0200, Otto Moerbeek wrote:
> > On Sun, Apr 09, 2023 at 08:20:43AM +0200, Otto Moerbeek wrote:
>
> I would prefer if every utrace() call is a full line (in other words ulog
> should be line buffered
e compiled with MALLOC_STATS defined. If run
> > > > > with option D it dumps its state to a malloc.out file at exit. This
> > > > > state can be used to find leaks amongst other things.
> > > > >
> > > > > This is not ideal for pledged pr
.Op Fl t Ar trstr
> +.Op Fl u Ar word
I would use the term 'label' (instead of 'word'), as it is the way it is called
inside utrace(2) man page.
> .Sh DESCRIPTION
> .Nm
> displays the kernel trace files produced with
> @@ -106,6 +107,18 @@ See the
> opt
at exit. This
> > > > state can be used to find leaks amongst other things.
> > > >
> > > > This is not ideal for pledged processes, as they often have no way to
> > > > write files.
> > > >
> > > > This changes malloc to
> > This is not ideal for pledged processes, as they often have no way to
> > > write files.
> > >
> > > This changes malloc to use utrace(2) for that.
> > >
> > > As kdump has no nice way to show those lines without all extras it
> > > no
TATS defined. If run
> > with option D it dumps its state to a malloc.out file at exit. This
> > state can be used to find leaks amongst other things.
> >
> > This is not ideal for pledged processes, as they often have no way to
> > write files.
> >
> > This
ption D it dumps its state to a malloc.out file at exit. This
> state can be used to find leaks amongst other things.
>
> This is not ideal for pledged processes, as they often have no way to
> write files.
>
> This changes malloc to use utrace(2) for that.
>
> As kdu
ongst other things.
This is not ideal for pledged processes, as they often have no way to
write files.
This changes malloc to use utrace(2) for that.
As kdump has no nice way to show those lines without all extras it
normally shows, so add two options to it to just show the lines.
To use, compil
The following diff should allow most of utrace to run without kernel lock.
It makes utrace() less expensive if ktrace is not used.
--
:wq Claudio
Index: kern/kern_ktrace.c
===
RCS file: /cvs/src/sys/kern/kern_ktrace.c,v
retrieving r
On Mon, Jul 18, 2011 at 11:35:42AM +0200, Otto Moerbeek wrote:
> On Tue, Jul 12, 2011 at 05:52:09PM +0200, Otto Moerbeek wrote:
>
> > Hi,
> >
> > The diff below implements utrace(2), a syscall to introduce data into
> > a ktrace stream from a userland program.
&
Hi,
Index: lib/libc/sys/utrace.2
===
RCS file: lib/libc/sys/utrace.2
diff -N lib/libc/sys/utrace.2
--- /dev/null 1 Jan 1970 00:00:00 -
+++ lib/libc/sys/utrace.2 18 Jul 2011 09:28:15 -
@@ -0,0 +1,93
On Tue, Jul 12, 2011 at 05:52:09PM +0200, Otto Moerbeek wrote:
> Hi,
>
> The diff below implements utrace(2), a syscall to introduce data into
> a ktrace stream from a userland program.
>
> The interface is taken from netbsd, freebsd also has a utrace(2)
> syscall, but lac
On Tue, Jul 12, 2011 at 05:52:09PM +0200, Otto Moerbeek wrote:
> The diff below implements utrace(2), a syscall to introduce data into
> a ktrace stream from a userland program.
>
> The interface is taken from netbsd, freebsd also has a utrace(2)
> syscall, but lacks the label argu
#x27;t want to have to add another stub to the ramdisk build bits...)
Agreed, I think utrace(2) should always be implemented, and just not
do anything if the kernel's compiled without KTRACE.
On Tue, Jul 12, 2011 at 8:52 AM, Otto Moerbeek wrote:
...
> diff -u -p -r1.117 syscalls.master
> --- sys/kern/syscalls.master9 Jul 2011 05:46:26 - 1.117
> +++ sys/kern/syscalls.master12 Jul 2011 14:59:03 -
> @@ -572,3 +572,9 @@
>int flag); }
> 326
On Tue, Jul 12, 2011, Otto Moerbeek wrote:
> The diff below implements utrace(2), a syscall to introduce data into
> a ktrace stream from a userland program.
> Index: sys/kern/kern_ktrace.c
> ===
> RCS file: /c
Hi,
The diff below implements utrace(2), a syscall to introduce data into
a ktrace stream from a userland program.
The interface is taken from netbsd, freebsd also has a utrace(2)
syscall, but lacks the label argument.
You could uise this as a debugging aid, to get tarce information
intermixed
28 matches
Mail list logo