1. 08 1月, 2010 1 次提交
    • J
      lib/vsprintf.c: Add %pMF to format FDDI bit reversed MAC addresses · bc7259a2
      Joe Perches 提交于
      On Mon, 2010-01-04 at 23:43 +0000, Maciej W. Rozycki wrote:
      > The example below shows an address, and the sequence of bits or symbols
      > that would be transmitted when the address is used in the Source Address
      > or Destination Address fields on the MAC header.  The transmission line
      > shows the address bits in the order transmitted, from left to right.  For
      > IEEE 802 LANs these correspond to actual bits on the medium.  The FDDI
      > symbols line shows how the FDDI PHY sends the address bits as encoded
      > symbols.
      >
      >         MSB:            35:7B:12:00:00:01
      >         Canonical:      AC-DE-48-00-00-80
      >         Transmission:   00110101 01111011 00010010 00000000 00000000 00000001
      >         FDDI Symbols:   35 7B 12 00 00 01"
      >
      > Please note that this address has its group bit clear.
      >
      >  This notation is also defined in the "FDDI MEDIA ACCESS CONTROL-2
      > (MAC-2)" (X3T9/92-120) document although that book does not have a need
      > to use the MSB form and it's skipped.
      
      Adds 6 bytes to object size for x86
      
      New:
      $ size lib/vsprintf.o
         text	   data	    bss	    dec	    hex	filename
         8664	      0	      2	   8666	   21da	lib/vsprintf.o
      $ size lib/vsprintf.o
         text    data     bss     dec     hex filename
         8658       0       2    8660    21d4 lib/vsprintf.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc7259a2
  2. 18 12月, 2009 1 次提交
  3. 16 12月, 2009 10 次提交
  4. 05 11月, 2009 4 次提交
  5. 02 10月, 2009 1 次提交
  6. 23 9月, 2009 1 次提交
  7. 22 9月, 2009 1 次提交
  8. 18 9月, 2009 2 次提交
    • S
      vsnprintf: remove duplicate comment of vsnprintf · 0efb4d20
      Steven Rostedt 提交于
      Remove the duplicate comment of bstr_printf that is the same as the
      vsnprintf.
      
      Add the 's' option to the comment for the pointer function. This is
      more of an internal function so the little duplication of the comment
      here is OK.
      Reported-by: NZhaolei <zhaolei@cn.fujitsu.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0efb4d20
    • S
      vsprintf: add %ps that is the same as %pS but is like %pf · 91adcd2c
      Steven Rostedt 提交于
      On PowerPC64 function pointers do not point directly at the functions,
      but instead point to pointers to the functions. The output of %pF expects
      to point to a pointer to the function, whereas %pS will show the function
      itself.
      
      mcount returns the direct pointer to the function and not the pointer to
      the pointer. Thus %pS must be used to show this. The function tracer
      requires printing of the functions without offsets and uses the %pf
      instead.
      
       %pF produces run_local_timers+0x4/0x1f
       %pf produces just run_local_timers
      
      For PowerPC64, we need to use the direct pointer, and we only have
      %pS which will produce .run_local_timers+0x4/0x1f
      
      This patch creates a %ps that matches the %pf as %pS matches %pF.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      91adcd2c
  9. 29 8月, 2009 1 次提交
  10. 30 4月, 2009 1 次提交
    • F
      vsprintf: introduce %pf format specifier · 0c8b946e
      Frederic Weisbecker 提交于
      A printf format specifier which would allow us to print a pure
      function name has been suggested by Andrew Morton a couple of
      months ago.
      
      The current %pF is very convenient to print a function symbol,
      but often we only want to print the name of the function, without
      its asm offset.
      
      That's what  %pf does in this patch.  The lowecase f has been chosen
      for its intuitive meaning of a 'weak kind of %pF'.
      
      The support for this new format would be welcome by the tracing code
      where the need to print pure function names is often needed. This is
      also true for other parts of the kernel:
      
      $ git-grep -E "kallsyms_lookup\(.+?\)"
      arch/blackfin/kernel/traps.c:   symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf);
      arch/powerpc/xmon/xmon.c:               name = kallsyms_lookup(pc, &size, &offset, NULL, tmpstr);
      arch/sh/kernel/cpu/sh5/unwind.c:        sym = kallsyms_lookup(pc, NULL, &offset, NULL, namebuf);
      arch/x86/kernel/ftrace.c:       kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str);
      kernel/kprobes.c:               sym = kallsyms_lookup((unsigned long)p->addr, NULL,
      kernel/lockdep.c:       return kallsyms_lookup((unsigned long)key, NULL, NULL, NULL, str);
      kernel/trace/ftrace.c:  kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
      kernel/trace/ftrace.c:  kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
      kernel/trace/ftrace.c:  kallsyms_lookup((unsigned long)rec->ops->func, NULL, NULL, NULL, str);
      kernel/trace/ftrace.c:  kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
      kernel/trace/ftrace.c:  kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
      kernel/trace/ftrace.c:  kallsyms_lookup(rec->ip, NULL, NULL, &modname, str);
      kernel/trace/ftrace.c:  kallsyms_lookup(*ptr, NULL, NULL, NULL, str);
      kernel/trace/trace_functions.c: kallsyms_lookup(ip, NULL, NULL, NULL, str);
      kernel/trace/trace_output.c:    kallsyms_lookup(address, NULL, NULL, NULL, str);
      
      Changes in v2:
      
      - Add the explanation of the %pf role for vsnprintf() and bstr_printf()
      
      - Change the comments by dropping the "asm offset" notion and only
        define the %pf against the actual function offset notion.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20090415154817.GC5989@nowhere>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0c8b946e
  11. 08 4月, 2009 2 次提交
  12. 14 3月, 2009 2 次提交
  13. 10 3月, 2009 1 次提交
    • F
      vsprintf: fix bug in negative value printing · 39e874f8
      Frederic Weisbecker 提交于
      Sitsofe Wheeler found and bisected that while unifying the
      vsprintf format decoding in:
      
        fef20d9c: vsprintf: unify the format decoding layer for its 3 users
      
      The sign flag has been dropped out in favour of
      precise types (ie: LONG/ULONG).
      
      But the format helper number() still needs this flag to keep track of
      the signedness unless it will consider all numbers as unsigned.
      
      Also add an explicit cast to int (for %d) while parsing with va_arg()
      to ensure the highest bit is well extended on the 64 bits number that
      hosts the value in case of negative values.
      Reported-Bisected-Tested-by: NSitsofe Wheeler <sitsofe@yahoo.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <20090309201503.GA5010@nowhere>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      39e874f8
  14. 07 3月, 2009 2 次提交
    • F
      vsprintf: unify the format decoding layer for its 3 users · fef20d9c
      Frederic Weisbecker 提交于
      An new optimization is making its way to ftrace. Its purpose is to
      make trace_printk() consuming less memory and be faster.
      
      Written by Lai Jiangshan, the approach is to delay the formatting
      job from tracing time to output time.
      
      Currently, a call to trace_printk() will format the whole string and
      insert it into the ring buffer. Then you can read it on /debug/tracing/trace
      file.
      
      The new implementation stores the address of the format string and
      the binary parameters into the ring buffer, making the packet more compact
      and faster to insert.
      Later, when the user exports the traces, the format string is retrieved
      with the binary parameters and the formatting job is eventually done.
      
      The new implementation rewrites a lot of format decoding bits from
      vsnprintf() function, making now 3 differents functions to maintain
      in their duplicated parts of printf format decoding bits.
      
      Suggested by Ingo Molnar, this patch tries to factorize the most
      possible common bits from these functions.
      The real common part between them is the format decoding. Although
      they do somewhat similar jobs, their way to export or import the parameters
      is very different. Thus, only the decoding layer is extracted, unless you see
      other parts that could be worth factorized.
      
      Changes in V2:
      
      - Address a suggestion from Linus to group the format_decode() parameters inside
        a structure.
      
      Changes in v3:
      
      - Address other cleanups suggested by Ingo and Linus such as passing the
        printf_spec struct to the format helpers: pointer()/number()/string()
        Note that this struct is passed by copy and not by address. This is to
        avoid side effects because these functions often change these values and the
        changes shoudn't be persistant when a callee helper returns.
        It would be too risky.
      
      - Various cleanups (code alignement, switch/case instead of if/else fountains).
      
      - Fix a bug that printed the first format specifier following a %p
      
      Changes in v4:
      
      - drop unapropriate const qualifier loss while casting fmt to a char *
        (thanks to Vegard Nossum for having pointed this out).
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1236356510-8381-6-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fef20d9c
    • L
      vsprintf: add binary printf · 4370aa4a
      Lai Jiangshan 提交于
      Impact: add new APIs for binary trace printk infrastructure
      
      vbin_printf(): write args to binary buffer, string is copied
      when "%s" is occurred.
      
      bstr_printf(): read from binary buffer for args and format a string
      
      [fweisbec@gmail.com: rebase]
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1236356510-8381-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4370aa4a
  15. 07 1月, 2009 1 次提交
  16. 04 1月, 2009 1 次提交
  17. 25 11月, 2008 1 次提交
  18. 04 11月, 2008 1 次提交
  19. 30 10月, 2008 2 次提交
  20. 29 10月, 2008 1 次提交
  21. 28 10月, 2008 1 次提交
  22. 21 10月, 2008 1 次提交
  23. 17 10月, 2008 1 次提交
    • H
      lib: remove defining macros for strict_strto?? · 9d85db22
      Harvey Harrison 提交于
      Open-code them rather than using defining macros.  The function bodies are now
      next to their kerneldoc comments as a bonus.
      
      Add casts to the signed cases as they call into the unsigned versions.
      
      Avoids the sparse warnings:
      lib/vsprintf.c:249:1: warning: incorrect type in argument 3 (different signedness)
      lib/vsprintf.c:249:1:    expected unsigned long *res
      lib/vsprintf.c:249:1:    got long *res
      lib/vsprintf.c:249:1: warning: incorrect type in argument 3 (different signedness)
      lib/vsprintf.c:249:1:    expected unsigned long *res
      lib/vsprintf.c:249:1:    got long *res
      lib/vsprintf.c:251:1: warning: incorrect type in argument 3 (different signedness)
      lib/vsprintf.c:251:1:    expected unsigned long long *res
      lib/vsprintf.c:251:1:    got long long *res
      lib/vsprintf.c:251:1: warning: incorrect type in argument 3 (different signedness)
      lib/vsprintf.c:251:1:    expected unsigned long long *res
      lib/vsprintf.c:251:1:    got long long *res
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9d85db22