lkml.org 
[lkml]   [2004]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: 2.6.9-rc3-mm3
    Nick Sanders <sandersn@btinternet.com> wrote:
    >> I get the following oops when booting and it also stops kde
    >> (artswrapper) from starting with the same call trace. USB seems to
    >> be working which is good.

    On Thu, Oct 07, 2004 at 02:50:07AM -0700, Andrew Morton wrote:
    > Could you please do
    > cd /usr/src/linux
    > wget ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.9-rc3/2.6.9-rc3-mm3/broken-out/optimize-profile-path-slightly.patch
    > patch -R -p1 < optimize-profile-path-slightly.patch
    > and retest?

    Here is a more likely correct patch for what that was trying to do,
    however misguided that may be. Untested, uncompiled, vs. 2.6.9-rc3-mm3
    without the bad patch:

    Expose some variables from kernel/profile.c to the world to short-
    circuit some checks in some inline wrappers for the purportedly
    ``heavier'' profiling functions. I took the liberty of declaring
    some variables extern in the bodies of the inlines, which is rare
    in the kernel, but protects against the use of the now-exposed
    variables by things that shouldn't touch them.

    Signed-off-by: William Irwin <wli@holomorphy.com>

    Index: mm3-2.6.9-rc3/kernel/profile.c
    ===================================================================
    --- mm3-2.6.9-rc3.orig/kernel/profile.c 2004-10-07 04:07:13.019223245 -0700
    +++ mm3-2.6.9-rc3/kernel/profile.c 2004-10-07 04:38:08.299177821 -0700
    @@ -34,10 +34,10 @@
    #define NR_PROFILE_HIT (PAGE_SIZE/sizeof(struct profile_hit))
    #define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)

    -static atomic_t *prof_buffer;
    +atomic_t *prof_buffer;
    static unsigned long prof_len, prof_shift;
    -static int prof_on;
    -static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
    +int prof_on;
    +cpumask_t prof_cpu_mask = CPU_MASK_ALL;
    #ifdef CONFIG_SMP
    static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
    static DEFINE_PER_CPU(int, cpu_profile_flip);
    @@ -284,14 +284,12 @@
    up(&profile_flip_mutex);
    }

    -void profile_hit(int type, void *__pc)
    +void fastcall __profile_hit(void *__pc)
    {
    unsigned long primary, secondary, flags, pc = (unsigned long)__pc;
    int i, j, cpu;
    struct profile_hit *hits;

    - if (prof_on != type || !prof_buffer)
    - return;
    pc = min((pc - (unsigned long)_stext) >> prof_shift, prof_len - 1);
    i = primary = (pc & (NR_PROFILE_GRP - 1)) << PROFILE_GRPSHIFT;
    secondary = (~(pc << 1) & (NR_PROFILE_GRP - 1)) << PROFILE_GRPSHIFT;
    @@ -392,14 +390,6 @@
    }
    #endif /* !CONFIG_SMP */

    -void profile_tick(int type, struct pt_regs *regs)
    -{
    - if (type == CPU_PROFILING)
    - profile_hook(regs);
    - if (!user_mode(regs) && cpu_isset(smp_processor_id(), prof_cpu_mask))
    - profile_hit(type, (void *)profile_pc(regs));
    -}
    -
    #ifdef CONFIG_PROC_FS
    #include <linux/proc_fs.h>
    #include <asm/uaccess.h>
    Index: mm3-2.6.9-rc3/include/linux/profile.h
    ===================================================================
    --- mm3-2.6.9-rc3.orig/include/linux/profile.h 2004-10-07 04:03:39.960613077 -0700
    +++ mm3-2.6.9-rc3/include/linux/profile.h 2004-10-07 04:28:46.333609573 -0700
    @@ -8,6 +8,7 @@
    #include <linux/init.h>
    #include <linux/cpumask.h>
    #include <asm/errno.h>
    +#include <asm/atomic.h>

    #define CPU_PROFILING 1
    #define SCHED_PROFILING 2
    @@ -17,8 +18,8 @@

    /* init basic kernel profiler */
    void __init profile_init(void);
    -void profile_tick(int, struct pt_regs *);
    -void profile_hit(int, void *);
    +void FASTCALL(__profile_hit(void *));
    +
    #ifdef CONFIG_PROC_FS
    void create_prof_cpu_mask(struct proc_dir_entry *);
    #else
    @@ -101,6 +102,26 @@

    #endif /* CONFIG_PROFILING */

    +static inline void profile_hit(int type, void *pc)
    +{
    + extern int prof_on;
    + extern atomic_t *prof_buffer;
    +
    + if (prof_on == type && prof_buffer)
    + __profile_hit(pc);
    +}
    +
    +static inline void profile_tick(int type, struct pt_regs *regs)
    +{
    + extern cpumask_t prof_cpu_mask;
    +
    + if (type != CPU_PROFILING)
    + return;
    + profile_hook(regs);
    + if (!user_mode(regs) && cpu_isset(smp_processor_id(), prof_cpu_mask))
    + profile_hit(type, (void *)profile_pc(regs));
    +}
    +
    #endif /* __KERNEL__ */

    #endif /* _LINUX_PROFILE_H */
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 14:06    [W:0.032 / U:95.792 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site