Skip to content
Snippets Groups Projects
  1. Oct 14, 2008
    • Frederic Weisbecker's avatar
      tracing/fastboot: fix initcalls disposition in bootgraph.pl · ddc7a01a
      Frederic Weisbecker authored
      
      When bootgraph.pl parses a file, it gives one row
      for each initcall's pid. But only few of them will
      be displayed => the longest.
      
      This patch corrects it by giving only a rows for pids
      which have initcalls that will be displayed.
      
      [ mingo@elte.hu: resolved conflicts ]
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ddc7a01a
    • Arjan van de Ven's avatar
      tracing/fastboot: add a script to visualize the kernel boot process / time · aa5d9151
      Arjan van de Ven authored
      
      When optimizing the kernel boot time, it's very valuable to visualize
      what is going on at which time. In addition, with the fastboot asynchronous
      initcall level, it's very valuable to see which initcall gets run where
      and when.
      
      This patch adds a script to turn a dmesg into a SVG graph (that can be
      shown with tools such as InkScape, Gimp or Firefox) and a small change
      to the initcall code to print the PID of the thread calling the initcall
      (so that the script can work out the parallelism).
      
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      aa5d9151
    • Steven Rostedt's avatar
      ftrace: remove warning of old objcopy and local functions · d53475b5
      Steven Rostedt authored
      
      The warning messages about old objcopy and local functions spam the
      user quite drastically.  Remove the warning until we can find a nicer
      way of tell the user to upgrade their objcopy.
      
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d53475b5
    • Andrew Morton's avatar
      kbuild: ftrace: don't assume that scripts/recordmcount.pl is executable · b3a32041
      Andrew Morton authored
      
      CHK     include/linux/version.h
        CHK     include/linux/utsrelease.h
        CC      scripts/mod/empty.o
      /bin/sh: /usr/src/25/scripts/recordmcount.pl: Permission denied
      
      We shouldn't assume that files have their `x' bits set.  There are various
      ways in which file permissions get lost, including use of patch(1).
      
      It might not be correct to assume that perl lives in $PATH?
      
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b3a32041
    • Steven Rostedt's avatar
      ftrace: objcopy version test for local symbols · f2f8458e
      Steven Rostedt authored
      
      The --globalize-symbols option came out in objcopy version 2.17.
      If the kernel is being compiled on a system with a lower version of
      objcopy, then we can not use the globalize / localize trick to
      link to symbols pointing to local functions.
      
      This patch tests the version of objcopy and will only use the trick
      if the version is greater than or equal to 2.17. Otherwise, if an
      object has only local functions within a section, it will give a
      nice warning and recommend the user to upgrade their objcopy.
      
      Leaving the symbols unrecorded is not that big of a deal, since the
      mcount record method changes the actual mcount code to be a simple
      "ret" without recording registers or anything.
      
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f2f8458e
    • Steven Rostedt's avatar
      ftrace: handle weak symbol functions · 8feff1ca
      Steven Rostedt authored
      
      During tests and checks, I've discovered that there were failures to
      convert mcount callers into nops. Looking deeper into these failures,
      code that was attempted to be changed was not an mcount caller.
      The current code only updates if the code being changed is what it expects,
      but I still investigate any time there is a failure.
      
      What was happening is that a weak symbol was being used as a reference
      for other mcount callers. That weak symbol was also referenced elsewhere
      so the offsets were using the strong symbol and not the function symbol
      that it was referenced from.
      
      This patch changes the setting up of the mcount_loc section to search
      for a global function that is not weak. It will pick a local over a weak
      but if only a weak is found in a section, a warning is printed and the
      mcount location is not recorded (just to be safe).
      
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8feff1ca
    • Steven Rostedt's avatar
      ftrace: update recordmount.pl arch changes · d74fcd1e
      Steven Rostedt authored
      
      I'm trying to keep all the arch changes in recordmcount.pl in one place.
      I moved your code into that area, by adding the flags to the commands
      that were passed in.
      
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d74fcd1e
    • Jeremy Fitzhardinge's avatar
      ftrace: fix build problem with CONFIG_FTRACE · 6a4917e3
      Jeremy Fitzhardinge authored
      
      I'm seeing when I use separate src/build dirs:
      
      make[3]: *** [arch/x86/kernel/time_32.o] Error 1
      /bin/sh: scripts/recordmcount.pl: No such file or directory
      make[3]: *** [arch/x86/kernel/irq_32.o] Error 1
      /bin/sh: scripts/recordmcount.pl: No such file or directory
      make[3]: *** [arch/x86/kernel/ldt.o] Error 1
      /bin/sh: scripts/recordmcount.pl: No such file or directory
      make[3]: *** [arch/x86/kernel/i8259.o] Error 1
      /bin/sh: scripts/recordmcount.pl: No such file or directory
      
      This fixes it.
      
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6a4917e3
    • Ingo Molnar's avatar
      ftrace: scripts/recordmcount.pl cross-build hack · 3989cce8
      Ingo Molnar authored
      
      hack around:
      
       ld: Relocatable linking with relocations from format elf32-i386 (init/.tmp_gl_calibrate.o) to format elf64-x86-64 (init/.tmp_mx_calibrate.o) i  CC      arch/x86/mm/extable.o
       objcopy: 'init/.tmp_mx_calibrate.o': No such file
       rm: cannot remove `init/.tmp_mx_calibrate.o': No such file or directory
       ld: Relocatable linking with relocations from format elf32-i386 (arch/x86/mm/extable.o) to format elf64-x86-64 (arch/x86/mm/.tmp_mx_extable.o) is not supported
       mv: cannot stat `arch/x86/mm/.tmp_mx_extable.o': No such file or directory
       ld: Relocatable linking with relocations from format elf32-i386 (arch/x86/mm/fault.o) to format elf64-x86-64 (arch/x86/mm/.tmp_mx_fault.o) is not supported
      
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3989cce8
    • Steven Rostedt's avatar
      ftrace: create __mcount_loc section · 8da3821b
      Steven Rostedt authored
      
      This patch creates a section in the kernel called "__mcount_loc".
      This will hold a list of pointers to the mcount relocation for
      each call site of mcount.
      
      For example:
      
      objdump -dr init/main.o
      [...]
      Disassembly of section .text:
      
      0000000000000000 <do_one_initcall>:
         0:   55                      push   %rbp
      [...]
      000000000000017b <init_post>:
       17b:   55                      push   %rbp
       17c:   48 89 e5                mov    %rsp,%rbp
       17f:   53                      push   %rbx
       180:   48 83 ec 08             sub    $0x8,%rsp
       184:   e8 00 00 00 00          callq  189 <init_post+0xe>
                              185: R_X86_64_PC32      mcount+0xfffffffffffffffc
      [...]
      
      We will add a section to point to each function call.
      
         .section __mcount_loc,"a",@progbits
      [...]
         .quad .text + 0x185
      [...]
      
      The offset to of the mcount call site in init_post is an offset from
      the start of the section, and not the start of the function init_post.
      The mcount relocation is at the call site 0x185 from the start of the
      .text section.
      
        .text + 0x185  == init_post + 0xa
      
      We need a way to add this __mcount_loc section in a way that we do not
      lose the relocations after final link.  The .text section here will
      be attached to all other .text sections after final link and the
      offsets will be meaningless.  We need to keep track of where these
      .text sections are.
      
      To do this, we use the start of the first function in the section.
      do_one_initcall.  We can make a tmp.s file with this function as a reference
      to the start of the .text section.
      
         .section __mcount_loc,"a",@progbits
      [...]
         .quad do_one_initcall + 0x185
      [...]
      
      Then we can compile the tmp.s into a tmp.o
      
        gcc -c tmp.s -o tmp.o
      
      And link it into back into main.o.
      
        ld -r main.o tmp.o -o tmp_main.o
        mv tmp_main.o main.o
      
      But we have a problem.  What happens if the first function in a section
      is not exported, and is a static function. The linker will not let
      the tmp.o use it.  This case exists in main.o as well.
      
      Disassembly of section .init.text:
      
      0000000000000000 <set_reset_devices>:
         0:   55                      push   %rbp
         1:   48 89 e5                mov    %rsp,%rbp
         4:   e8 00 00 00 00          callq  9 <set_reset_devices+0x9>
                              5: R_X86_64_PC32        mcount+0xfffffffffffffffc
      
      The first function in .init.text is a static function.
      
      00000000000000a8 t __setup_set_reset_devices
      000000000000105f t __setup_str_set_reset_devices
      0000000000000000 t set_reset_devices
      
      The lowercase 't' means that set_reset_devices is local and is not exported.
      If we simply try to link the tmp.o with the set_reset_devices we end
      up with two symbols: one local and one global.
      
       .section __mcount_loc,"a",@progbits
       .quad set_reset_devices + 0x10
      
      00000000000000a8 t __setup_set_reset_devices
      000000000000105f t __setup_str_set_reset_devices
      0000000000000000 t set_reset_devices
                       U set_reset_devices
      
      We still have an undefined reference to set_reset_devices, and if we try
      to compile the kernel, we will end up with an undefined reference to
      set_reset_devices, or even worst, it could be exported someplace else,
      and then we will have a reference to the wrong location.
      
      To handle this case, we make an intermediate step using objcopy.
      We convert set_reset_devices into a global exported symbol before linking
      it with tmp.o and set it back afterwards.
      
      00000000000000a8 t __setup_set_reset_devices
      000000000000105f t __setup_str_set_reset_devices
      0000000000000000 T set_reset_devices
      
      00000000000000a8 t __setup_set_reset_devices
      000000000000105f t __setup_str_set_reset_devices
      0000000000000000 T set_reset_devices
      
      00000000000000a8 t __setup_set_reset_devices
      000000000000105f t __setup_str_set_reset_devices
      0000000000000000 t set_reset_devices
      
      Now we have a section in main.o called __mcount_loc that we can place
      somewhere in the kernel using vmlinux.ld.S and access it to convert
      all these locations that call mcount into nops before starting SMP
      and thus, eliminating the need to do this with kstop_machine.
      
      Note, A well documented perl script (scripts/recordmcount.pl) is used
      to do all this in one location.
      
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8da3821b
  2. Oct 10, 2008
  3. Oct 06, 2008
    • Mathieu Desnoyers's avatar
      Marker depmod fix core kernel list · 87f3b6b6
      Mathieu Desnoyers authored
      
      * Theodore Ts'o (tytso@mit.edu) wrote:
      >
      > I've been playing with adding some markers into ext4 to see if they
      > could be useful in solving some problems along with Systemtap.  It
      > appears, though, that as of 2.6.27-rc8, markers defined in code which is
      > compiled directly into the kernel (i.e., not as modules) don't show up
      > in Module.markers:
      >
      > kvm_trace_entryexit arch/x86/kvm/kvm-intel  %u %p %u %u %u %u %u %u
      > kvm_trace_handler arch/x86/kvm/kvm-intel  %u %p %u %u %u %u %u %u
      > kvm_trace_entryexit arch/x86/kvm/kvm-amd  %u %p %u %u %u %u %u %u
      > kvm_trace_handler arch/x86/kvm/kvm-amd  %u %p %u %u %u %u %u %u
      >
      > (Note the lack of any of the kernel_sched_* markers, and the markers I
      > added for ext4_* and jbd2_* are missing as wel.)
      >
      > Systemtap apparently depends on in-kernel trace_mark being recorded in
      > Module.markers, and apparently it's been claimed that it used to be
      > there.  Is this a bug in systemtap, or in how Module.markers is getting
      > built?   And is there a file that contains the equivalent information
      > for markers located in non-modules code?
      
      I think the problem comes from "markers: fix duplicate modpost entry"
      (commit d35cb360)
      
      Especially :
      
        -   add_marker(mod, marker, fmt);
        +   if (!mod->skip)
        +     add_marker(mod, marker, fmt);
          }
          return;
         fail:
      
      Here is a fix that should take care if this problem.
      
      Thanks for the bug report!
      
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Tested-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      CC: Greg KH <greg@kroah.com>
      CC: David Smith <dsmith@redhat.com>
      CC: Roland McGrath <roland@redhat.com>
      CC: Sam Ravnborg <sam@ravnborg.org>
      CC: Wenji Huang <wenji.huang@oracle.com>
      CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      87f3b6b6
  4. Sep 29, 2008
  5. Sep 23, 2008
  6. Sep 09, 2008
  7. Sep 05, 2008
  8. Aug 26, 2008
    • Serge E. Hallyn's avatar
      selinux: add support for installing a dummy policy (v2) · 93c06cbb
      Serge E. Hallyn authored
      
      In August 2006 I posted a patch generating a minimal SELinux policy.  This
      week, David P. Quigley posted an updated version of that as a patch against
      the kernel.  It also had nice logic for auto-installing the policy.
      
      Following is David's original patch intro (preserved especially
      bc it has stats on the generated policies):
      
      se interested in the changes there were only two significant
      changes. The first is that the iteration through the list of classes
      used NULL as a sentinel value. The problem with this is that the
      class_to_string array actually has NULL entries in its table as place
      holders for the user space object classes.
      
      The second change was that it would seem at some point the initial sids
      table was NULL terminated. This is no longer the case so that iteration
      has to be done on array length instead of looking for NULL.
      
      Some statistics on the policy that it generates:
      
      The policy consists of 523 lines which contain no blank lines. Of those
      523 lines 453 of them are class, permission, and initial sid
      definitions. These lines are usually little to no concern to the policy
      developer since they will not be adding object classes or permissions.
      Of the remaining 70 lines there is one type, one role, and one user
      statement. The remaining lines are broken into three portions. The first
      group are TE allow rules which make up 29 of the remaining lines, the
      second is assignment of labels to the initial sids which consist of 27
      lines, and file system labeling statements which are the remaining 11.
      
      In addition to the policy.conf generated there is a single file_contexts
      file containing two lines which labels the entire system with base_t.
      
      This policy generates a policy.23 binary that is 7920 bytes.
      
      (then a few versions later...):
      
      The new policy is 587 lines (stripped of blank lines) with 476 of those
      lines being the boilerplate that I mentioned last time. The remaining
      111 lines have the 3 lines for type, user, and role, 70 lines for the
      allow rules (one for each object class including user space object
      classes), 27 lines to assign types to the initial sids, and 11 lines for
      file system labeling. The policy binary is 9194 bytes.
      
      Changelog:
      
      	Aug 26: Added Documentation/SELinux.txt
      	Aug 26: Incorporated a set of comments by Stephen Smalley:
      		1. auto-setup SELINUXTYPE=dummy
      		2. don't auto-install if selinux is enabled with
      			non-dummy policy
      		3. don't re-compute policy version
      		4. /sbin/setfiles not /usr/sbin/setfiles
      	Aug 22: As per JMorris comments, made sure make distclean
      		cleans up the mdp directory.
      		Removed a check for file_contexts which is now
      		created in the same file as the check, making it
      		superfluous.
      
      Signed-off-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: default avatarDavid Quigley <dpquigl@tycho.nsa.gov>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      93c06cbb
  9. Aug 21, 2008
  10. Aug 06, 2008
  11. Aug 05, 2008
  12. Aug 04, 2008
  13. Aug 02, 2008
  14. Jul 31, 2008
  15. Jul 30, 2008
  16. Jul 25, 2008
    • Sebastian Siewior's avatar
      setlocalversion: do not describe if there is nothing to describe · 56b2f070
      Sebastian Siewior authored
      
      Jan Engelhardt wrote:
      > Just a note that when you run git-describe, you should probably quiten it.
      >
      > fatal: cannot describe 'bd7364a0fd5a4a2878fe4a224be1b142a4e6698e'
      >
      > This happens when tags are not present, which can happen if Linus's tree
      > is sent upwards again, IOW:
      >
      >  machine1$  git-clone torvalds/linux-2.6.git
      >  machine1$  git push elsewhere master
      >
      >  machine2$  git-clone elsewhere:/linux
      >  machine2$  git-describe HEAD
      >  fatal: cannot describe that
      
      Signed-off-by: default avatarSebastian Siewior <sebastian@breakpoint.cc>
      Acked-by: default avatarJan Engelhardt <jengelh@medozas.de>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      56b2f070
    • Sam Ravnborg's avatar
      kconfig: make defconfig is no longer chatty · 09748e17
      Sam Ravnborg authored
      
      make defconfig generated a lot of output
      then noone actually read.
      Use conf_set_all_new_symbols() to generate the default
      configuration and avoid the chatty output.
      
      A typical run now looks like this:
      $ make  defconfig
      *** Default configuration is based on 'i386_defconfig'
      arch/x86/configs/i386_defconfig:13:warning: trying to assign nonexistent symbol SEMAPHORE_SLEEPERS
      arch/x86/configs/i386_defconfig:176:warning: trying to assign nonexistent symbol PREEMPT_BKL
      ...
      arch/x86/configs/i386_defconfig:1386:warning: trying to assign nonexistent symbol INSTRUMENTATION
      $
      
      As an added benefit we now clearly see the warnings generated
      in the start of the process.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      09748e17
    • Sam Ravnborg's avatar
      kconfig: make oldconfig is now less chatty · cd9140e1
      Sam Ravnborg authored
      
      Previously when running "make oldconfig" we saw all the propmt lines
      from kconfig and noone actully read this.
      
      With this patch the user will only see output if there is new symbols.
      This will be seen as "make oldconfig" runs which does not generate any output.
      
      A typical run now looks like this:
      
      $ make oldconfig
      scripts/kconfig/conf -o arch/x86/Kconfig
      $
      
      If a new symbol is found then we restart the config process like this:
      $ make oldconfig
      scripts/kconfig/conf -o arch/x86/Kconfig
      *
      * Restart config...
      *
      *
      * General setup
      *
      Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
      Local version - append to kernel release (LOCALVERSION) []
      ...
      
      The bahaviour is similar to what we know when running the implicit
      oldconfig target "make silentoldconfig".
      "make silentoldconfig" are run as part of the kernel build process
      if the configuration has changed.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      cd9140e1
    • Sam Ravnborg's avatar
      kconfig: speed up all*config + randconfig · f443d2ec
      Sam Ravnborg authored
      
      Drop the chatty mode when we generate the all*config, randconfig
      configurations.
      Ths speeds up the process considerably and noone looked
      at the output anyway.
      This patch uses the conf_set_all_new_symbols() function
      just added to kconfig.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      f443d2ec
    • Roman Zippel's avatar
      kconfig: set all new symbols automatically · dc7862e5
      Roman Zippel authored
      
      Add conf_set_all_new_symbols() which set all symbols (which don't have a
      value yet) to a specifed value.
      
      Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      dc7862e5
    • Tim Bird's avatar
      kconfig: add diffconfig utility · a717417e
      Tim Bird authored
      
      Diffconfig is a simple utility for comparing two kernel configuration files.
      See usage in the script for more info.
      
      Signed-off-by: default avatarTim Bird <tim.bird@am.sony.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      a717417e
    • Randy Dunlap's avatar
      kernel-doc: handle/strip __init · 74fc5c65
      Randy Dunlap authored
      
      Handle __init in functions with kernel-doc notation by stripping the
      __init away from the output doc.  This is already being done for
      "__devinit".  This patch fixes these kernel-doc error/aborts:
      
      Error(linux-next-20080619//drivers/usb/gadget/config.c:132): cannot understand prototype: 'struct usb_descriptor_header **__init usb_copy_descriptors(struct usb_descriptor_header **src) '
      Error(linux-next-20080619//drivers/usb/gadget/config.c:182): cannot understand prototype: 'struct usb_endpoint_descriptor *__init usb_find_endpoint( 	struct usb_descriptor_header **src, 	struct usb_descriptor_header **copy, 	struct usb_endpoint_descriptor *match ) '
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      74fc5c65
    • Sam Ravnborg's avatar
      kbuild: prepare headers_* for arch/$ARCH/include · 2fb9b1bd
      Sam Ravnborg authored
      
      Factor out the headers_*_all support to a seperate
      shell script and add support for arch specific
      header files can be located in either
      
          arch/$ARCH/include/asm
      or
          include/asm-$ARCH/
      
      In "make help" always display the headers_* targets.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      2fb9b1bd
    • Sam Ravnborg's avatar
      kbuild: install all headers when arch is changed · db1bec4f
      Sam Ravnborg authored
      
      We see some header files that are selected dependent on
      the actual architecture so force a reinstallation
      of all header files when the arch changes.
      This slows down "make headers_check_all" but then
      we better reflect reality.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      db1bec4f
    • Sam Ravnborg's avatar
      kbuild: optimize headers_* targets · 7712401a
      Sam Ravnborg authored
      
      Move the core functionality of headers_install
      and headers_check to two small perl scripts.
      The makefile is adapted to use the perl scrip and
      changed to operate on all files in a directory.
      So if one file is changed then all files in the
      directory is processed.
      
      perl were chosen for the helper scripts because this
      is pure text processing which perl is good at and
      especially the headers_check.pl script are expected to
      see changes / new checks implmented.
      
      The speed is ~300% faster on this box.
      And the output generated to the screen is now down to
      two lines per directory (one for install, one for check)
      so it is easier to scroll back after a kernel build.
      
      The perl scripts has been brought to sanity by patient
      feedback from: Vegard Nossum <vegard.nossum@gmail.com>
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      7712401a
Loading