Modify ktr(4) to be typesafe
authorAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Fri, 30 Dec 2011 13:38:34 +0000 (05:38 -0800)
committerAggelos Economopoulos <aggelos@pearl.nodomain>
Fri, 30 Dec 2011 17:22:03 +0000 (18:22 +0100)
commit5bf48697e4f53509dec31ef5b2474f8744bd8712
tree19199686bfe8bb6d2392e6bae3095c3abb32b0a6
parent2de5e81cb248b4997606ed2be65dea05883d7ca7
Modify ktr(4) to be typesafe

- Use a struct copy to place the logged values directly into the
  destination buffer without forcing a memcpy.
- This also fixes event logging on x86_64, as we no longer rely
  on the i386 calling convention for functions with a variable
  number of arguments.
- Verify that the arguments match the specified format.
- Update callsites.

Note that this requires userspace changes! ktrdump(8) needs to be
adjusted even on i386 (%c and %hd are no longer promoted as per the
C rules). We need very special handling on x86_64 too.
19 files changed:
sys/bus/usb/usb_mem.c
sys/dev/disk/dm/targets/crypt/dm_target_crypt.c
sys/dev/netif/bge/if_bge.c
sys/dev/netif/em/if_em.c
sys/dev/netif/emx/if_emx.c
sys/kern/dsched/bfq/bfq_ktr.h
sys/kern/kern_ktr.c
sys/kern/kern_poll.c
sys/kern/kern_slaballoc.c
sys/kern/kern_synch.c
sys/kern/lwkt_ipiq.c
sys/kern/lwkt_serialize.c
sys/kern/lwkt_thread.c
sys/kern/lwkt_token.c
sys/net/if.c
sys/net/if_ethersubr.c
sys/platform/pc32/i386/trap.c
sys/platform/pc64/x86_64/trap.c
sys/sys/ktr.h