Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (3 years ago)
Author:
alain
Message:

All modifications required to support the <tcp_chat> application
including error recovery in case of packet loss.A

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_kill.c

    r664 r683  
    22 * sys_kill.c - Kernel function implementing the "kill" system call.
    33 *
    4  * Author    Alain Greiner (2016,2017,2018)
     4 * Author    Alain Greiner     (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    6767    process_t * process = this->process;
    6868
    69 #if (DEBUG_SYS_KILL || CONFIG_INSTRUMENTATION_SYSCALLS)
     69#if DEBUG_SYS_KILL || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
    7070uint64_t     tm_start = hal_get_cycles();
    7171#endif
    7272
    7373#if DEBUG_SYS_KILL
    74 tm_start = hal_get_cycles();
    7574if( DEBUG_SYS_KILL < tm_start )
    7675printk("\n[%s] thread[%x,%x] enter : %s to process %x / cycle %d\n",
     
    9594
    9695#if DEBUG_SYSCALLS_ERROR
    97 printk("\n[ERROR] in %s : process %x not found\n", __FUNCTION__, pid );
     96if( DEBUG_SYSCALLS_ERROR < tm_start )
     97printk("\n[ERROR] in %s : thread[%x,%x] / process %x not found\n",
     98__FUNCTION__, process->pid, this->trdid, pid );
    9899#endif
    99100        this->errno = EINVAL;
     
    175176
    176177#if DEBUG_SYSCALLS_ERROR
    177 printk("\n[ERROR] in %s : process %x cannot kill itself\n", __FUNCTION__, pid );
     178if( DEBUG_SYSCALLS_ERROR < tm_start )
     179printk("\n[ERROR] in %s : thread[%x,%x] / process %x cannot kill itself\n",
     180__FUNCTION__, process->pid, this->trdid, pid );
    178181#endif
    179182                this->errno = EINVAL;
     
    186189
    187190#if DEBUG_SYSCALLS_ERROR
    188 printk("\n[ERROR] in %s : process_init cannot be killed\n", __FUNCTION__ );
     191if( DEBUG_SYSCALLS_ERROR < tm_start )
     192printk("\n[ERROR] in %s : thread[%x,%x] / process_init cannot be killed\n",
     193 __FUNCTION__, process->pid, this->trdid);
    189194#endif
    190195                        this->errno = EINVAL;
     
    219224
    220225#if DEBUG_SYSCALLS_ERROR
    221 printk("\n[ERROR] in %s : illegal signal %d / process %x\n", __FUNCTION__, sig_id, pid );
     226if( DEBUG_SYSCALLS_ERROR < tm_start )
     227printk("\n[ERROR] in %s : thread[%x,%x] / illegal signal %d\n",
     228__FUNCTION__, process->pid, this->trdid, sig_id );
    222229#endif
    223230            this->errno = EINVAL;
     
    234241#if DEBUG_SYS_KILL
    235242if( DEBUG_SYS_KILL < tm_end )
    236 printk("\n[%s] thread[%x,%x] exit / process %x / %s / cost = %d / cycle %d\n",
     243printk("\n[%s] thread[%x,%x] exit / process %x / %s / cycle %d\n",
    237244__FUNCTION__ , this->process->pid, this->trdid, pid,
    238 sig_type_str(sig_id), (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );
     245sig_type_str(sig_id), (uint32_t)tm_end );
    239246#endif
    240247
Note: See TracChangeset for help on using the changeset viewer.