git: Modify ktr(4) to be typesafe

Aggelos Economopoulos aggelos at crater.dragonflybsd.org
Fri Dec 30 09:22:23 PST 2011


commit 5bf48697e4f53509dec31ef5b2474f8744bd8712
Author: Aggelos Economopoulos <aoiko at cc.ece.ntua.gr>
Date:   Fri Dec 30 05:38:34 2011 -0800

    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.

Summary of changes:
 sys/bus/usb/usb_mem.c                           |   24 +++---
 sys/dev/disk/dm/targets/crypt/dm_target_crypt.c |   18 ++--
 sys/dev/netif/bge/if_bge.c                      |    6 +-
 sys/dev/netif/em/if_em.c                        |   10 +-
 sys/dev/netif/emx/if_emx.c                      |   10 +-
 sys/kern/dsched/bfq/bfq_ktr.h                   |    9 ++-
 sys/kern/kern_ktr.c                             |   63 ++++++---------
 sys/kern/kern_poll.c                            |    4 +-
 sys/kern/kern_slaballoc.c                       |   37 ++++-----
 sys/kern/kern_synch.c                           |   10 +-
 sys/kern/lwkt_ipiq.c                            |   24 +++---
 sys/kern/lwkt_serialize.c                       |   26 +++---
 sys/kern/lwkt_thread.c                          |   13 +--
 sys/kern/lwkt_token.c                           |   23 +++---
 sys/net/if.c                                    |   18 ++--
 sys/net/if_ethersubr.c                          |   10 +-
 sys/platform/pc32/i386/trap.c                   |   21 +++---
 sys/platform/pc64/x86_64/trap.c                 |   21 +++---
 sys/sys/ktr.h                                   |   97 ++++++++++++++++------
 19 files changed, 239 insertions(+), 205 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5bf48697e4f53509dec31ef5b2474f8744bd8712


-- 
DragonFly BSD source repository





More information about the Commits mailing list