The NetBSD Project

CVS log for src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c

[BACK] Up to [cvs.NetBSD.org] / src / external / cddl / osnet / dist / lib / libdtrace / common

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Apr 1 18:33:23 2024 UTC (12 months, 3 weeks ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +2 -2 lines
elftoolchain: Be consistent about which ELF header files we use.

1. For tools that use elftoolchain: always use elftoolchain's
   elfdefinitions.h.  Don't even think about looking at the host's
   sys/exec_elf.h, which makes no sense and should never happen.

   (ELF tools that don't use elftoolchain, like m68k-elf2coff,
   continue to use nbincludes/sys/exec_elf.h.  But no more nbincludes
   hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
   sys/exec_elf.h, even in Solaris components via sys/elf.h.
   elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
   elfdefinitions.h via libelf header files (libelf.h, gelf.h).

   libdtrace in particular requires _all_ R_* reloc type definitions,
   but sys/exec_elf.h brings in only the _current machine's_ R_*
   reloc type definitions.  (While here: Use uintptr_t instead of
   Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
   provided only by sys/exec_elf.h, not by elfdefinitions.h.)

   And most userland components using libelf don't rely on any
   properties of the current machine from sys/exec_elf.h, so they can
   use libelf's elfdefinition.h.

   Exceptions:

   - dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
     but it also relies on sys/dtrace.h -> sys/elf.h ->
     elfdefinitions.h like other userland components using sys/elf.h.

   - kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
     sys/elf.h -> elfdefinitions like other userland components using
     sys/elf.h.

   - t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
     core files, but relies on sys/exec_elf.h for struct
     netbsd_elfcore_procinfo.

   None of these exceptions needs all R_* reloc type definitions, so
   as a workaround, we can just suppress libelf's elfdefinitions.h by
   defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
   exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake.  This was:

- half bogus workarounds for missing build_install dependencies in
  tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
  tools involving libelf instead of libelf's elfdefinitions.h, which
  collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.

Revision 1.17.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:04:20 2020 UTC (5 years ago) by martin
Branches: phil-wifi
Diff to: previous 1.17: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17: +2 -3 lines
Merge changes from current as of 20200406

Revision 1.17.4.1: download - view: text, markup, annotated - select for diffs
Wed Feb 12 19:55:56 2020 UTC (5 years, 2 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE
Diff to: previous 1.17: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17: +2 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #701):

	external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
	external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
	external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
	sys/modules/cyclic/Makefile: revision 1.5
	external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
	external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
	sys/arch/aarch64/aarch64/vectors.S: revision 1.10
	external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
	external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
	external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
	external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
	external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
	sys/arch/aarch64/include/cpu.h: revision 1.20
	external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

        stp     x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue.  In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit.  No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register.  Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region.  Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic.  (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Feb 12 01:10:08 2020 UTC (5 years, 2 months ago) by riastradh
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -3 lines
Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Revision 1.15.12.1: download - view: text, markup, annotated - select for diffs
Mon Jun 25 07:25:17 2018 UTC (6 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15: +90 -21 lines
Sync with HEAD

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat Jun 2 01:19:46 2018 UTC (6 years, 10 months ago) by christos
Branches: MAIN
CVS tags: phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, netbsd-9-base, netbsd-9-0-RC2, netbsd-9-0-RC1
Branch point for: phil-wifi, netbsd-9
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +4 -4 lines
Use a constant to prevent dynamic array allocation which messes up SSP.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon May 28 21:05:05 2018 UTC (6 years, 10 months ago) by chs
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +90 -21 lines
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().

Revision 1.1.1.3 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon May 28 20:52:53 2018 UTC (6 years, 10 months ago) by chs
Branches: sun, FreeBSD
CVS tags: CDDL-FreeBSD-r315983
Diff to: previous 1.1.1.2: preferred, colored
Changes since revision 1.1.1.2: +509 -25 lines
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.

Revision 1.14.2.1: download - view: text, markup, annotated - select for diffs
Sat Aug 6 00:18:41 2016 UTC (8 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14: +3 -2 lines
Sync with HEAD

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Aug 3 16:37:02 2016 UTC (8 years, 8 months ago) by christos
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: pgoyette-compat
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -2 lines
machdep.booted_kernel is not an absolute path, make it so. Now u_int is
found but its parent is not :-)

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Jun 30 00:23:36 2016 UTC (8 years, 9 months ago) by pgoyette
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160726
Branch point for: pgoyette-localcount
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +1 -0 lines
Add missing dp_proc_unlock() in error path.

From PR kern/51285 (Henning Petersen)

XXX Pullup to 7 and 7-0

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Apr 28 00:02:40 2016 UTC (9 years ago) by christos
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -1 lines
Introduce dt_bootfile() and use it to avoid hard-coded kernel values. Fixes
dtrace hang for kernels not named netbsd.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Oct 6 01:18:47 2015 UTC (9 years, 6 months ago) by riz
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +1 -1 lines
Make this build for me.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Oct 5 17:48:09 2015 UTC (9 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +7 -3 lines
load the kernel for NetBSD (for now)

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sun Oct 4 23:25:32 2015 UTC (9 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +30 -0 lines
put back module filename finding code.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Sep 24 14:25:29 2015 UTC (9 years, 7 months ago) by christos
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +441 -75 lines
sync with FreeBSD

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Feb 7 20:30:03 2015 UTC (10 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +4 -0 lines
check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.

Revision 1.6.2.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:04:08 2012 UTC (13 years ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6: +1 -1 lines
sync with head

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Feb 13 13:05:36 2012 UTC (13 years, 2 months ago) by wiz
Branches: MAIN
CVS tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, agc-symver-base, agc-symver
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +1 -1 lines
Use the correct path in dt_module.c.
From clang via Henning Petersen in PR 46009.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Jul 26 12:28:01 2011 UTC (13 years, 9 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base
Branch point for: yamt-pagecache
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +0 -2 lines
remove a debug printf

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Mar 1 11:19:40 2010 UTC (15 years, 1 month ago) by darran
Branches: MAIN
CVS tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +8 -4 lines
DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Feb 27 23:43:52 2010 UTC (15 years, 2 months ago) by haad
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +11 -8 lines
Merge NetBSD local changes to new zfs version 22 sources.

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Sat Feb 27 22:30:03 2010 UTC (15 years, 2 months ago) by haad
Branches: sun, FreeBSD
CVS tags: osnet-20100224
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +11 -5 lines
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Feb 21 01:46:34 2010 UTC (15 years, 2 months ago) by darran
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +38 -8 lines
Apply NetBSD changes to DTrace.

Ok with core@.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Feb 21 00:49:54 2010 UTC (15 years, 2 months ago) by darran
Branches: MAIN
CVS tags: darran-pre-netbsd
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +98 -7 lines
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Sat Feb 20 04:33:45 2010 UTC (15 years, 2 months ago) by darran
Branches: sun, FreeBSD
CVS tags: osnet-20081117, darran-pre-freebsd
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Feb 20 04:33:45 2010 UTC (15 years, 2 months ago) by darran
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>