lkml.org 
[lkml]   [1999]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: wchan in 2.2.0-final
    From
    Date
    Meelis Roos <mroos@tartu.cyber.ee> writes:

    |> For some strange reason 2.2.0-final doesn't show me the wchan info any
    |> more:
    |>
    |> mroos@roos:~>ps l
    |> FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
    |> 100 557 439 1 0 0 1280 864 S 2 0:00 -bash
    |> 100 557 440 1 10 0 1272 848 S 3 0:00 -bash
    |> 0 557 517 439 0 0 3312 1344 S 2 0:00 pine linu
    |> 100000 557 519 440 12 0 1032 492 R 3 0:00 ps l
    |>
    |> The System.map is there and has the same date as vmlinuz.

    Please try this patch:

    --- linux-2.2.0-final/fs/proc/array.c.~2~ Wed Jan 20 18:04:47 1999
    +++ linux-2.2.0-final/fs/proc/array.c Mon Jan 25 01:22:58 1999
    @@ -511,10 +511,11 @@
    extern void scheduling_functions_end_here(void);
    #define first_sched ((unsigned long) scheduling_functions_start_here)
    #define last_sched ((unsigned long) scheduling_functions_end_here)
    +#define real_tsk(tsk) (*(tsk)->tarray_ptr)

    static unsigned long get_wchan(struct task_struct *p)
    {
    - if (!p || p == current || p->state == TASK_RUNNING)
    + if (!p || real_tsk(p) == current || p->state == TASK_RUNNING)
    return 0;
    #if defined(__i386__)
    {
    @@ -522,7 +523,7 @@
    unsigned long stack_page;
    int count = 0;

    - stack_page = (unsigned long)p;
    + stack_page = (unsigned long)real_tsk(p);
    esp = p->tss.esp;
    if (!stack_page || esp < stack_page || esp >= 8188+stack_page)
    return 0;
    @@ -564,7 +565,7 @@
    unsigned long stack_page;
    int count = 0;

    - stack_page = (unsigned long)p;
    + stack_page = (unsigned long)real_tsk(p);
    fp = ((struct switch_stack *)p->tss.ksp)->a6;
    do {
    if (fp < stack_page+sizeof(struct task_struct) ||
    @@ -585,7 +586,7 @@
    unsigned long stack_page;
    int count = 0;

    - stack_page = 4096 + (unsigned long)p;
    + stack_page = 4096 + (unsigned long)real_tsk(p);
    fp = get_css_fp (&p->tss);
    do {
    if (fp < stack_page || fp > 4092+stack_page)
    @@ -599,7 +600,7 @@
    #elif defined (__sparc__)
    {
    unsigned long pc, fp, bias = 0;
    - unsigned long task_base = (unsigned long) p;
    + unsigned long task_base = (unsigned long) real_tsk(p);
    struct reg_window *rw;
    int count = 0;

    @@ -624,8 +625,8 @@
    }

    #if defined(__i386__)
    -# define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019])
    -# define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1022])
    +# define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)real_tsk(tsk)))[1019])
    +# define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)real_tsk(tsk)))[1022])
    #elif defined(__alpha__)
    /*
    * See arch/alpha/kernel/ptrace.c for details.
    @@ -633,11 +634,11 @@
    # define PT_REG(reg) (PAGE_SIZE - sizeof(struct pt_regs) \
    + (long)&((struct pt_regs *)0)->reg)
    # define KSTK_EIP(tsk) \
    - (*(unsigned long *)(PT_REG(pc) + PAGE_SIZE + (unsigned long)(tsk)))
    + (*(unsigned long *)(PT_REG(pc) + PAGE_SIZE + (unsigned long)real_tsk(tsk)))
    # define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->tss.usp)
    #elif defined(CONFIG_ARM)
    -# define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1022])
    -# define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1020])
    +# define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)real_tsk(tsk)))[1022])
    +# define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)real_tsk(tsk)))[1020])
    #elif defined(__mc68000__)
    #define KSTK_EIP(tsk) \
    ({ \
    @@ -646,7 +647,7 @@
    MAP_NR((tsk)->tss.esp0) < max_mapnr) \
    eip = ((struct pt_regs *) (tsk)->tss.esp0)->pc; \
    eip; })
    -#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->tss.usp)
    +#define KSTK_ESP(tsk) (real_tsk(tsk) == current ? rdusp() : (tsk)->tss.usp)
    #elif defined(__powerpc__)
    #define KSTK_EIP(tsk) ((tsk)->tss.regs->nip)
    #define KSTK_ESP(tsk) ((tsk)->tss.regs->gpr[1])
    --
    Andreas Schwab "And now for something
    schwab@issan.cs.uni-dortmund.de completely different"
    schwab@gnu.org

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:49    [W:2.833 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site