tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: tprof(8) ABI
On 15/04/2026 05:09, Kevin Bowling wrote:
> I implemented a tprof driver for mips octeon, but the port typically
> runs an n32 userland. This can be worked around by compiling an LP64
> tprof(8), but I am not sure how that would work with the package sets.
> Since it is a developer tool, I propose intentionally breaking the ABI
> like the following patch. I think it would improve other 32 on 64
> situations at the cost of an ABI break, but it is a developer tool in
> /usr/sbin so maybe this is the most pragmatic solution?
> --- a/sys/dev/tprof/tprof_types.h
> +++ b/sys/dev/tprof/tprof_types.h
> @@ -50,7 +50,8 @@ typedef struct {
> uint32_t s_flags; /* flags and counterID */
> #define TPROF_SAMPLE_INKERNEL 0x00000001 /* s_pc is in kernel address space */
> #define TPROF_SAMPLE_COUNTER_MASK 0xff000000 /*
> 0..(TPROF_MAXCOUNTERS-1) */
> - uintptr_t s_pc; /* program counter */
> + uint64_t s_pc; /* program counter; uint64_t for ABI compat
> + * with 64-bit kernels and n32/ILP32 userland */
> } tprof_sample_t;
> typedef struct tprof_param {
I have mostly completely forgotten MIPS ABIs, but shouldn't the PC just be sign extended?
Home |
Main Index |
Thread Index |
Old Index