1. 12 6月, 2009 1 次提交
  2. 08 4月, 2009 1 次提交
    • L
      Fix build errors due to CONFIG_BRANCH_TRACER=y · aeeae868
      Linus Torvalds 提交于
      The code that enables branch tracing for all (non-constant) branches
      plays games with the preprocessor and #define's the C 'if ()' construct
      to do tracing.
      
      That's all fine, but it fails for some unusual but valid C code that is
      sometimes used in macros, notably by the intel-iommu code:
      
      	if (i=drhd->iommu, drhd->ignored) ..
      
      because now the preprocessor complains about multiple arguments to the
      'if' macro.
      
      So make the macro expansion of this particularly horrid trick use
      varargs, and handle the case of comma-expressions in if-statements.  Use
      another macro to do it cleanly in just one place.
      
      This replaces a patch by David (and acked by Steven) that did this all
      inside that one already-too-horrid macro.
      Tested-by: NIngo Molnar <mingo@elte.hu>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aeeae868
  3. 07 4月, 2009 2 次提交
  4. 18 3月, 2009 1 次提交
  5. 03 1月, 2009 1 次提交
    • L
      Sanitize gcc version header includes · f153b821
      Linus Torvalds 提交于
       - include the gcc version-dependent header files from the generic gcc
         header file, rather than the other way around (iow: don't make the
         non-gcc header file have to know about gcc versions)
      
       - don't include compiler-gcc4.h for gcc 5 (for whenever it gets
         released).  That's just confusing and made us do odd things in the
         gcc4 header file (testing that we really had version 4!)
      
       - generate the name from the __GNUC__ version directly, rather than
         having a mess of #if conditionals.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f153b821
  6. 23 11月, 2008 3 次提交
    • S
      trace: profile all if conditionals · 2bcd521a
      Steven Rostedt 提交于
      Impact: feature to profile if statements
      
      This patch adds a branch profiler for all if () statements.
      The results will be found in:
      
        /debugfs/tracing/profile_branch
      
      For example:
      
         miss      hit    %        Function                  File              Line
       ------- ---------  -        --------                  ----              ----
             0        1 100 x86_64_start_reservations      head64.c             127
             0        1 100 copy_bootdata                  head64.c             69
             1        0   0 x86_64_start_kernel            head64.c             111
            32        0   0 set_intr_gate                  desc.h               319
             1        0   0 reserve_ebda_region            head.c               51
             1        0   0 reserve_ebda_region            head.c               47
             0        1 100 reserve_ebda_region            head.c               42
             0        0   X maxcpus                        main.c               165
      
      Miss means the branch was not taken. Hit means the branch was taken.
      The percent is the percentage the branch was taken.
      
      This adds a significant amount of overhead and should only be used
      by those analyzing their system.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2bcd521a
    • S
      trace: consolidate unlikely and likely profiler · 45b79749
      Steven Rostedt 提交于
      Impact: clean up to make one profiler of like and unlikely tracer
      
      The likely and unlikely profiler prints out the file and line numbers
      of the annotated branches that it is profiling. It shows the number
      of times it was correct or incorrect in its guess. Having two
      different files or sections for that matter to tell us if it was a
      likely or unlikely is pretty pointless. We really only care if
      it was correct or not.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      45b79749
    • S
      trace: remove extra assign in branch check · 42f565e1
      Steven Rostedt 提交于
      Impact: clean up of branch check
      
      The unlikely/likely profiler does an extra assign of the f.line.
      This is not needed since it is already calculated at compile time.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      42f565e1
  7. 13 11月, 2008 1 次提交
  8. 12 11月, 2008 2 次提交
    • I
      tracing: branch tracer, fix vdso crash · 2b7d0390
      Ingo Molnar 提交于
      Impact: fix bootup crash
      
      the branch tracer missed arch/x86/vdso/vclock_gettime.c from
      disabling tracing, which caused such bootup crashes:
      
        [  201.840097] init[1]: segfault at 7fffed3fe7c0 ip 00007fffed3fea2e sp 000077
      
      also clean up the ugly ifdefs in arch/x86/kernel/vsyscall_64.c by
      creating DISABLE_UNLIKELY_PROFILE facility for code to turn off
      instrumentation on a per file basis.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2b7d0390
    • S
      tracing: profile likely and unlikely annotations · 1f0d69a9
      Steven Rostedt 提交于
      Impact: new unlikely/likely profiler
      
      Andrew Morton recently suggested having an in-kernel way to profile
      likely and unlikely macros. This patch achieves that goal.
      
      When configured, every(*) likely and unlikely macro gets a counter attached
      to it. When the condition is hit, the hit and misses of that condition
      are recorded. These numbers can later be retrieved by:
      
        /debugfs/tracing/profile_likely    - All likely markers
        /debugfs/tracing/profile_unlikely  - All unlikely markers.
      
      # cat /debug/tracing/profile_unlikely | head
       correct incorrect  %        Function                  File              Line
       ------- ---------  -        --------                  ----              ----
          2167        0   0 do_arch_prctl                  process_64.c         832
             0        0   0 do_arch_prctl                  process_64.c         804
          2670        0   0 IS_ERR                         err.h                34
         71230     5693   7 __switch_to                    process_64.c         673
         76919        0   0 __switch_to                    process_64.c         639
         43184    33743  43 __switch_to                    process_64.c         624
         12740    64181  83 __switch_to                    process_64.c         594
         12740    64174  83 __switch_to                    process_64.c         590
      
      # cat /debug/tracing/profile_unlikely | \
        awk '{ if ($3 > 25) print $0; }' |head -20
         44963    35259  43 __switch_to                    process_64.c         624
         12762    67454  84 __switch_to                    process_64.c         594
         12762    67447  84 __switch_to                    process_64.c         590
          1478      595  28 syscall_get_error              syscall.h            51
             0     2821 100 syscall_trace_leave            ptrace.c             1567
             0        1 100 native_smp_prepare_cpus        smpboot.c            1237
         86338   265881  75 calc_delta_fair                sched_fair.c         408
        210410   108540  34 calc_delta_mine                sched.c              1267
             0    54550 100 sched_info_queued              sched_stats.h        222
         51899    66435  56 pick_next_task_fair            sched_fair.c         1422
             6       10  62 yield_task_fair                sched_fair.c         982
          7325     2692  26 rt_policy                      sched.c              144
             0     1270 100 pre_schedule_rt                sched_rt.c           1261
          1268    48073  97 pick_next_task_rt              sched_rt.c           884
             0    45181 100 sched_info_dequeued            sched_stats.h        177
             0       15 100 sched_move_task                sched.c              8700
             0       15 100 sched_move_task                sched.c              8690
         53167    33217  38 schedule                       sched.c              4457
             0    80208 100 sched_info_switch              sched_stats.h        270
         30585    49631  61 context_switch                 sched.c              2619
      
      # cat /debug/tracing/profile_likely | awk '{ if ($3 > 25) print $0; }'
         39900    36577  47 pick_next_task                 sched.c              4397
         20824    15233  42 switch_mm                      mmu_context_64.h     18
             0        7 100 __cancel_work_timer            workqueue.c          560
           617    66484  99 clocksource_adjust             timekeeping.c        456
             0   346340 100 audit_syscall_exit             auditsc.c            1570
            38   347350  99 audit_get_context              auditsc.c            732
             0   345244 100 audit_syscall_entry            auditsc.c            1541
            38     1017  96 audit_free                     auditsc.c            1446
             0     1090 100 audit_alloc                    auditsc.c            862
          2618     1090  29 audit_alloc                    auditsc.c            858
             0        6 100 move_masked_irq                migration.c          9
             1      198  99 probe_sched_wakeup             trace_sched_switch.c 58
             2        2  50 probe_wakeup                   trace_sched_wakeup.c 227
             0        2 100 probe_wakeup_sched_switch      trace_sched_wakeup.c 144
          4514     2090  31 __grab_cache_page              filemap.c            2149
         12882   228786  94 mapping_unevictable            pagemap.h            50
             4       11  73 __flush_cpu_slab               slub.c               1466
        627757   330451  34 slab_free                      slub.c               1731
          2959    61245  95 dentry_lru_del_init            dcache.c             153
           946     1217  56 load_elf_binary                binfmt_elf.c         904
           102       82  44 disk_put_part                  genhd.h              206
             1        1  50 dst_gc_task                    dst.c                82
             0       19 100 tcp_mss_split_point            tcp_output.c         1126
      
      As you can see by the above, there's a bit of work to do in rethinking
      the use of some unlikelys and likelys. Note: the unlikely case had 71 hits
      that were more than 25%.
      
      Note:  After submitting my first version of this patch, Andrew Morton
        showed me a version written by Daniel Walker, where I picked up
        the following ideas from:
      
        1)  Using __builtin_constant_p to avoid profiling fixed values.
        2)  Using __FILE__ instead of instruction pointers.
        3)  Using the preprocessor to stop all profiling of likely
             annotations from vsyscall_64.c.
      
      Thanks to Andrew Morton, Arjan van de Ven, Theodore Tso and Ingo Molnar
      for their feed back on this patch.
      
      (*) Not ever unlikely is recorded, those that are used by vsyscalls
       (a few of them) had to have profiling disabled.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Theodore Tso <tytso@mit.edu>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1f0d69a9
  9. 14 10月, 2008 1 次提交
  10. 18 8月, 2008 1 次提交
  11. 11 5月, 2008 1 次提交
  12. 05 3月, 2008 1 次提交
  13. 29 1月, 2008 2 次提交
  14. 26 10月, 2007 1 次提交
    • J
      Permit silencing of __deprecated warnings. · de488443
      Jeff Garzik 提交于
      The __deprecated marker is quite useful in highlighting the remnants of
      old APIs that want removing.
      
      However, it is quite normal for one or more years to pass, before the
      (usually ancient, bitrotten) code in question is either updated or
      deleted.
      
      Thus, like __must_check, add a Kconfig option that permits the silencing
      of this compiler warning.
      
      This change mimics the ifdef-ery and Kconfig defaults of MUST_CHECK as
      closely as possible.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      de488443
  15. 19 10月, 2007 1 次提交
  16. 27 7月, 2007 1 次提交
  17. 22 7月, 2007 1 次提交
    • A
      x86: Support __attribute__((__cold__)) in gcc 4.3 · a586df06
      Andi Kleen 提交于
      gcc 4.3 supports a new __attribute__((__cold__)) to mark functions cold. Any
      path directly leading to a call of this function will be unlikely. And gcc
      will try to generate smaller code for the function itself.
      
      Please use with care. The code generation advantage isn't large and in most
      cases it is not worth uglifying code with this.
      
      This patch marks some common error functions like panic(), printk()
      as cold.  This will longer term make many unlikely()s unnecessary, although
      we can keep them for now for older compilers.
      
      BUG is not marked cold because there is currently no way to tell
      gcc to mark a inline function told.
      
      Also all __init and __exit functions are marked cold. With a non -Os
      build this will tell the compiler to generate slightly smaller code
      for them. I think it currently only uses less alignments for labels,
      but that might change in the future.
      
      One disadvantage over *likely() is that they cannot be easily instrumented
      to verify them.
      
      Another drawback is that only the latest gcc 4.3 snapshots support this.
      Unfortunately we cannot detect this using the preprocessor. This means older
      snapshots will fail now. I don't think that's a problem because they are
      unreleased compilers that nobody should be using.
      
      gcc also has a __hot__ attribute, but I don't see any sense in using
      this in the kernel right now. But someday I hope gcc will be able
      to use more aggressive optimizing for hot functions even in -Os,
      if that happens it should be added.
      
      Includes compile fix from Thomas Gleixner.
      
      Cc: Jan Hubicka <jh@suse.cz>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a586df06
  18. 22 5月, 2007 1 次提交
  19. 10 5月, 2007 1 次提交
    • D
      compiler: introduce __used and __maybe_unused · 0d7ebbbc
      David Rientjes 提交于
      __used is defined to be __attribute__((unused)) for all pre-3.3 gcc
      compilers to suppress warnings for unused functions because perhaps they
      are referenced only in inline assembly.  It is defined to be
      __attribute__((used)) for gcc 3.3 and later so that the code is still
      emitted for such functions.
      
      __maybe_unused is defined to be __attribute__((unused)) for both function
      and variable use if it could possibly be unreferenced due to the evaluation
      of preprocessor macros.  Function prototypes shall be marked with
      __maybe_unused if the actual definition of the function is dependant on
      preprocessor macros.
      
      No update to compiler-intel.h is necessary because ICC supports both
      __attribute__((used)) and __attribute__((unused)) as specified by the gcc
      manual.
      
      __attribute_used__ is deprecated and will be removed once all current
      code is converted to using __used.
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Adrian Bunk <bunk@stusta.de>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0d7ebbbc
  20. 27 3月, 2007 1 次提交
  21. 13 12月, 2006 1 次提交
  22. 01 10月, 2006 1 次提交
  23. 30 9月, 2006 1 次提交
  24. 26 9月, 2006 1 次提交
  25. 04 5月, 2006 1 次提交
  26. 02 5月, 2006 1 次提交
  27. 09 1月, 2006 1 次提交
    • A
      [PATCH] Abandon gcc-2.95.x · fd285bb5
      Andrew Morton 提交于
      There's one scsi driver which doesn't compile due to weird __VA_ARGS__ tricks
      and the rather useful scsi/sd.c is currently getting an ICE.  None of the new
      SAS code compiles, due to extensive use of anonymous unions.  The V4L guys are
      very good at exploiting the gcc-2.95.x macro expansion bug (_why_ does each
      driver need to implement its own debug macros?) and various people keep on
      sneaking in anonymous unions, which are rather nice.
      
      Plus anonymous unions are rather useful.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fd285bb5
  28. 01 5月, 2005 1 次提交
  29. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4