Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/embedded_trace/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


This change supports "always on" tracing, in the sense that every function entry/exit
will have the ability to turn on tracing for that functions entry, and/or some or all exits. 
When 8l is invoked with the -pt switch, entry code looks like this: 
entry: jmp .+5
	call _tracein
	<rest of function>

To enable tracing, path the +5 to +2

Exits look like this:
	ret
	call _traceout
	ret

To enable exit tracing, patch the 1-byte ret to a nop. 
Patching can be done at runtime or statically before boot.
If this patch is accepted, the next step is to submit the support code for the kernel 
to allow it to be enabled at runtime. But, it will be also quite easy to have acid do the 
needed patching before boot as well. 

Ron

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.