1. 17 12月, 2009 5 次提交
    • R
      cf72e947
    • W
      MIPS: Tracing: Add dynamic function tracer support · 538f1952
      Wu Zhangjin 提交于
      With dynamic function tracer, by default, _mcount is defined as an
      "empty" function, it returns directly without any more action . When
      enabling it in user-space, it will jump to a real tracing
      function(ftrace_caller), and do the real job for us.
      
      Differ from the static function tracer, dynamic function tracer provides
      two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
      tracing of some indicated kernel functions(set_ftrace_filter).
      
      In the -v4 version, the implementation of this support is basically the same as
      X86 version does: _mcount is implemented as an empty function and ftrace_caller
      is implemented as a real tracing function respectively.
      
      But in this version, to support module tracing with the help of
      -mlong-calls in arch/mips/Makefile:
      
      MODFLAGS += -mlong-calls.
      
      The stuff becomes a little more complex. We need to cope with two
      different type of calling to _mcount.
      
      For the kernel part, the calling to _mcount(result of "objdump -hdr
      vmlinux"). is like this:
      
      	108:   03e0082d        move    at,ra
      	10c:   0c000000        jal     0 <fpcsr_pending>
                              10c: R_MIPS_26  _mcount
                              10c: R_MIPS_NONE        *ABS*
                              10c: R_MIPS_NONE        *ABS*
      	110:   00020021        nop
      
      For the module with -mlong-calls, it looks like this:
      
      	c:	3c030000 	lui	v1,0x0
      			c: R_MIPS_HI16	_mcount
      			c: R_MIPS_NONE	*ABS*
      			c: R_MIPS_NONE	*ABS*
      	10:	64630000 	daddiu	v1,v1,0
      			10: R_MIPS_LO16	_mcount
      			10: R_MIPS_NONE	*ABS*
      			10: R_MIPS_NONE	*ABS*
      	14:	03e0082d 	move	at,ra
      	18:	0060f809 	jalr	v1
      
      In the kernel version, there is only one "_mcount" string for every
      kernel function, so, we just need to match this one in mcount_regex of
      scripts/recordmcount.pl, but in the module version, we need to choose
      one of the two to match. Herein, I choose the first one with
      "R_MIPS_HI16 _mcount".
      
      and In the kernel verion, without module tracing support, we just need
      to replace "jal _mcount" by "jal ftrace_caller" to do real tracing, and
      filter the tracing of some kernel functions via replacing it by a nop
      instruction.
      
      but as we have described before, the instruction "jal ftrace_caller" only left
      32bit length for the address of ftrace_caller, it will fail when calling from
      the module space. so, herein, we must replace something else.
      
      the basic idea is loading the address of ftrace_caller to v1 via changing these
      two instructions:
      
      	lui	v1,0x0
      	addiu	v1,v1,0
      
      If we want to enable the tracing, we need to replace the above instructions to:
      
      	lui	v1, HI_16BIT_ftrace_caller
      	addiu	v1, v1, LOW_16BIT_ftrace_caller
      
      If we want to stop the tracing of the indicated kernel functions, we
      just need to replace the "jalr v1" to a nop instruction. but we need to
      replace two instructions and encode the above two instructions
      oursevles.
      
      Is there a simpler solution? Yes! Here it is, in this version, we put _mcount
      and ftrace_caller together, which means the address of _mcount and
      ftrace_caller is the same:
      
      _mcount:
      ftrace_caller:
      	j	ftrace_stub
      	 nop
      
      	...(do real tracing here)...
      
      ftrace_stub:
      	jr	ra
      	 move	ra, at
      
      By default, the kernel functions call _mcount, and then jump to ftrace_stub and
      return. and when we want to do real tracing, we just need to remove that "j
      ftrace_stub", and it will run through the two "nop" instructions and then do
      the real tracing job.
      
      what about filtering job? we just need to do this:
      
      	 lui v1, hi_16bit_of_mcount        <--> b 1f (0x10000004)
      	 addiu v1, v1, low_16bit_of_mcount
      	 move at, ra
      	 jalr v1
      	 nop
      	 				     1f: (rec->ip + 12)
      
      In linux-mips64, there will be some local symbols, whose name are
      prefixed by $L, which need to be filtered. thanks goes to Steven for
      writing the mips64-specific function_regex.
      
      In a conclusion, with RISC, things becomes easier with such a "stupid"
      trick, RISC is something like K.I.S.S, and also, there are lots of
      "simple" tricks in the whole ftrace support, thanks goes to Steven and
      the other folks for providing such a wonderful tracing framework!
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/675/Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      538f1952
    • W
      MIPS: Tracing: Add static function tracer support for MIPS · d2bb0762
      Wu Zhangjin 提交于
      If -pg of gcc is enabled with CONFIG_FUNCTION_TRACER=y. a calling to
      _mcount will be inserted into each kernel function. so, there is a
      possibility to trace the kernel functions in _mcount.
      
      This patch add the MIPS specific _mcount support for static function
      tracing. by default, ftrace_trace_function is initialized as
      ftrace_stub(an empty function), so, the default _mcount will introduce
      very little overhead. after enabling ftrace in user-space, it will jump
      to a real tracing function and do static function tracing for us.
      
      and -ffunction-sections is incompatible with -pg, so, disable it when
      ftracer is enabled.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/672/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d2bb0762
    • W
      MIPS: Loongson 2F: Add CPU frequency scaling support · f8ede0f7
      Wu Zhangjin 提交于
      Loongson 2F supports CPU clock scaling. When put it into wait mode by
      setting the frequency as ZERO it will stay in this mode until an external
      interrupt wakes the CPU again.
      
      To enable clock scaling support, an external timer of a known stable rate
      is required.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: cpufreq@vger.kernel.org,
      Cc: Dave Jones <davej@redhat.com>,
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
      Cc: yanh@lemote.com
      Cc: huhb@lemote.com,
      Patchwork: http://patchwork.linux-mips.org/patch/660/
      Patchwork: http://patchwork.linux-mips.org/patch/751/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f8ede0f7
    • D
      MIPS: PowerTV: Base files for Cisco PowerTV platform · a3a0f8c8
      David VomLehn 提交于
      Add the Cisco Powertv cable settop box to the MIPS tree. This platform is
      based on a MIPS 24Kc processor with various devices integrated on the same
      ASIC. There are multiple models of this box, with differing configuration
      but the same kernel runs across the product line.
      Signed-off-by: NDavid VomLehn <dvomlehn@cisco.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/132/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a3a0f8c8
  2. 26 9月, 2009 1 次提交
  3. 11 1月, 2009 2 次提交
  4. 28 10月, 2008 1 次提交
  5. 11 10月, 2008 1 次提交
  6. 04 10月, 2008 1 次提交
  7. 31 7月, 2008 2 次提交
  8. 16 7月, 2008 2 次提交
  9. 06 6月, 2008 1 次提交
  10. 12 5月, 2008 1 次提交
  11. 29 4月, 2008 5 次提交
  12. 17 4月, 2008 1 次提交
  13. 12 3月, 2008 1 次提交
  14. 27 11月, 2007 1 次提交
  15. 03 11月, 2007 1 次提交
  16. 30 10月, 2007 1 次提交
    • A
      [MIPS] txx9tmr clockevent/clocksource driver · 229f773e
      Atsushi Nemoto 提交于
      Convert jmr3927_clock_event_device to more generic
      txx9tmr_clock_event_device which supports one-shot mode.  The
      txx9tmr_clock_event_device can be used for TX49 too if the cp0 timer
      interrupt was not available.
      
      Convert jmr3927_hpt_read to txx9_clocksource driver which does not
      depends jiffies anymore.  The txx9_clocksource itself can be used for
      TX49, but normally TX49 uses higher precision clocksource_mips.
      Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      229f773e
  17. 23 10月, 2007 1 次提交
  18. 19 10月, 2007 1 次提交
  19. 15 10月, 2007 1 次提交
    • S
      kbuild: enable 'make CFLAGS=...' to add additional options to CC · a0f97e06
      Sam Ravnborg 提交于
      The variable CFLAGS is a wellknown variable and the usage by
      kbuild may result in unexpected behaviour.
      On top of that several people over time has asked for a way to
      pass in additional flags to gcc.
      
      This patch replace use of CFLAGS with KBUILD_CFLAGS all over the
      tree and enabling one to use:
      make CFLAGS=...
      to specify additional gcc commandline options.
      
      One usecase is when trying to find gcc bugs but other
      use cases has been requested too.
      
      Patch was tested on following architectures:
      alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k
      
      Test was simple to do a defconfig build, apply the patch and check
      that nothing got rebuild.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      a0f97e06
  20. 12 10月, 2007 2 次提交
  21. 27 8月, 2007 1 次提交
  22. 01 8月, 2007 1 次提交
  23. 13 7月, 2007 1 次提交
  24. 11 7月, 2007 4 次提交
  25. 05 3月, 2007 1 次提交