Changeset 580 for trunk/kernel/syscalls


Ignore:
Timestamp:
Oct 8, 2018, 11:31:42 AM (6 years ago)
Author:
alain
Message:

1) Register the kernel process in the cluster manager local list.
2) Introduce a new service in idbg : display the set of busylocks taken by a given thread.

Location:
trunk/kernel/syscalls
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/shared_include/shared_almos.h

    r445 r580  
    5151    DISPLAY_TXT_PROCESSES     = 6,
    5252    DISPLAY_DQDT              = 7,
     53    DISPLAY_BUSYLOCKS         = 8,
    5354}
    5455display_type_t;
  • trunk/kernel/syscalls/sys_display.c

    r506 r580  
    4848    else if( type == DISPLAY_CHDEV             ) return "CHDEV";
    4949    else if( type == DISPLAY_TXT_PROCESSES     ) return "TXT_PROCESSES";
     50    else if( type == DISPLAY_DQDT              ) return "DQDT";
     51    else if( type == DISPLAY_BUSYLOCKS         ) return "BUSYLOCKS";
    5052}
    5153#endif
     
    8789
    8890#if DEBUG_SYSCALLS_ERROR
    89 printk("\n[ERROR] in %s : string buffer %x unmapped / thread %x / process %x\n",
    90 __FUNCTION__ , (intptr_t)arg0 , this->trdid , process->pid );
     91printk("\n[ERROR] in %s for STRING : string buffer %x unmapped\n",
     92__FUNCTION__ , (intptr_t)arg0 );
    9193#endif
    9294            this->errno = EINVAL;
     
    101103
    102104#if DEBUG_SYSCALLS_ERROR
    103 printk("\n[ERROR] in %s : string length %d too large / thread %x / process %x\n",
    104 __FUNCTION__ , length , this->trdid , process->pid );
     105printk("\n[ERROR] in %s for STRING : string length %d too large\n",
     106__FUNCTION__ , length );
    105107#endif
    106108            this->errno = EINVAL;
     
    125127
    126128#if DEBUG_SYSCALLS_ERROR
    127 printk("\n[ERROR] in %s : illegal cxy argument %x / thread %x / process %x\n",
    128 __FUNCTION__ , cxy , this->trdid , process->pid );
     129printk("\n[ERROR] in %s for VMM : process %x in cluster %x not found\n",
     130__FUNCTION__ , pid , cxy );
    129131#endif
    130132            this->errno = EINVAL;
     
    139141
    140142#if DEBUG_SYSCALLS_ERROR
    141 printk("\n[ERROR] in %s : process %x in cluster %x not found / thread %x / process %x\n",
    142 __FUNCTION__ , pid , cxy , this->trdid , process->pid );
     143printk("\n[ERROR] in %s for VMM : process %x in cluster %x not found\n",
     144__FUNCTION__ , pid , cxy );
    143145#endif
    144146            this->errno = EINVAL;
     
    170172
    171173#if DEBUG_SYSCALLS_ERROR
    172 printk("\n[ERROR] in %s : illegal cxy argument %x / thread %x / process %x\n",
    173 __FUNCTION__ , cxy , this->trdid , process->pid );
     174printk("\n[ERROR] in %s for SCHED : illegal cxy argument %x\n",
     175__FUNCTION__ , cxy );
    174176#endif
    175177            this->errno = EINVAL;
     
    182184
    183185#if DEBUG_SYSCALLS_ERROR
    184 printk("\n[ERROR] in %s : illegal lid argument %x / thread %x / process %x\n",
    185 __FUNCTION__ , lid , this->trdid , process->pid );
     186printk("\n[ERROR] in %s for SCHED : illegal lid argument %x\n",
     187__FUNCTION__ , lid );
    186188#endif
    187189            this->errno = EINVAL;
     
    208210
    209211#if DEBUG_SYSCALLS_ERROR
    210 printk("\n[ERROR] in %s : illegal cxy argument %x / thread %x / process %x\n",
    211 __FUNCTION__ , cxy , this->trdid , process->pid );
     212printk("\n[ERROR] in %s for CLUSTER_PROCESSES : illegal cxy argument %x\n",
     213__FUNCTION__ , cxy );
    212214#endif
    213215            this->errno = EINVAL;
     
    216218
    217219        cluster_processes_display( cxy );
     220    }
     221    //////////////////////////////
     222    else if( type == DISPLAY_VFS )
     223    {
     224        vfs_display( process->vfs_root_xp );
     225    }
     226    ////////////////////////////////
     227    else if( type == DISPLAY_CHDEV )
     228    {
     229        chdev_dir_display();
    218230    }
    219231    ////////////////////////////////////////
     
    227239
    228240#if DEBUG_SYSCALLS_ERROR
    229 printk("\n[ERROR] in %s : illegal txt_id argument %d / thread %x / process %x\n",
    230 __FUNCTION__ , txt_id , this->trdid , process->pid );
     241printk("\n[ERROR] in %s for TXT_PROCESSES : illegal txt_id argument %d\n",
     242__FUNCTION__ , txt_id );
    231243#endif
    232244            this->errno = EINVAL;
     
    236248        process_txt_display( txt_id );
    237249    }
    238     //////////////////////////////
    239     else if( type == DISPLAY_VFS )
    240     {
    241         vfs_display( process->vfs_root_xp );
    242     }
    243     ////////////////////////////////
    244     else if( type == DISPLAY_CHDEV )
    245     {
    246         chdev_dir_display();
    247     }
    248     ////////////////////////////////
     250    ///////////////////////////////
    249251    else if( type == DISPLAY_DQDT )
    250252    {
    251253        dqdt_display();
     254    }
     255    ////////////////////////////////////
     256    else if( type == DISPLAY_BUSYLOCKS )
     257    {
     258        pid_t   pid   = (cxy_t)arg0;
     259        trdid_t trdid = (trdid_t)arg1;
     260
     261        // get extended pointer on target thread
     262        xptr_t thread_xp = thread_get_xptr( pid , trdid );
     263
     264        if( thread_xp == XPTR_NULL )
     265        {
     266
     267#if DEBUG_SYSCALLS_ERROR
     268printk("\n[ERROR] in %s for BUSYLOCKS : thread %x in process %x not found\n",
     269__FUNCTION__ , trdid , pid );
     270#endif
     271            this->errno = EINVAL;
     272            return -1;
     273        }
     274
     275        thread_display_busylocks( thread_xp );
    252276    }
    253277    ////
     
    256280
    257281#if DEBUG_SYSCALLS_ERROR
    258 printk("\n[ERROR] in %s : undefined display type %x / thread %x / process %x\n",
    259         __FUNCTION__ , type , this->trdid , process->pid );
     282printk("\n[ERROR] in %s : undefined display type %d\n",
     283        __FUNCTION__ , type );
    260284#endif
    261285        this->errno = EINVAL;
Note: See TracChangeset for help on using the changeset viewer.