Changeset a307beb in mainline
- Timestamp:
- 2010-04-14T14:41:54Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bdfd3c97
- Parents:
- e43cdac
- Location:
- kernel/generic
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/proc/task.h
re43cdac ra307beb 94 94 answerbox_t answerbox; /**< Communication endpoint */ 95 95 phone_t phones[IPC_MAX_PHONES]; 96 task_ipc_info_t ipc_info; /**< IPC statistics */ 96 97 /** 97 98 * Active asynchronous messages. It is used for limiting uspace to -
kernel/generic/include/ps/taskinfo.h
re43cdac ra307beb 46 46 47 47 typedef struct { 48 uint64_t call_sent; 49 uint64_t call_recieved; 50 uint64_t answer_sent; 51 uint64_t answer_recieved; 52 uint64_t irq_notif_recieved; 53 uint64_t forwarded; 54 } task_ipc_info_t; 55 56 typedef struct { 48 57 task_id_t taskid; 49 58 char name[TASK_NAME_BUFLEN]; … … 52 61 uint64_t ucycles; 53 62 uint64_t kcycles; 63 task_ipc_info_t ipc_info; 54 64 } task_info_t; 55 65 -
kernel/generic/src/ipc/ipc.c
re43cdac ra307beb 219 219 bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox)); 220 220 221 spinlock_lock(&TASK->lock); 222 TASK->ipc_info.answer_sent++; 223 spinlock_unlock(&TASK->lock); 224 221 225 call->flags |= IPC_CALL_ANSWERED; 222 226 … … 276 280 static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call) 277 281 { 282 spinlock_lock(&TASK->lock); 283 TASK->ipc_info.call_sent++; 284 spinlock_unlock(&TASK->lock); 285 278 286 if (!(call->flags & IPC_CALL_FORWARDED)) { 279 287 atomic_inc(&phone->active_calls); … … 376 384 int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, int mode) 377 385 { 386 spinlock_lock(&TASK->lock); 387 TASK->ipc_info.forwarded++; 388 spinlock_unlock(&TASK->lock); 389 378 390 spinlock_lock(&oldbox->lock); 379 391 list_remove(&call->link); … … 416 428 spinlock_lock(&box->lock); 417 429 if (!list_empty(&box->irq_notifs)) { 430 431 spinlock_lock(&TASK->lock); 432 TASK->ipc_info.irq_notif_recieved++; 433 spinlock_unlock(&TASK->lock); 434 418 435 ipl = interrupts_disable(); 419 436 spinlock_lock(&box->irq_lock); … … 425 442 interrupts_restore(ipl); 426 443 } else if (!list_empty(&box->answers)) { 444 spinlock_lock(&TASK->lock); 445 TASK->ipc_info.answer_recieved++; 446 spinlock_unlock(&TASK->lock); 447 427 448 /* Handle asynchronous answers */ 428 449 request = list_get_instance(box->answers.next, call_t, link); … … 430 451 atomic_dec(&request->data.phone->active_calls); 431 452 } else if (!list_empty(&box->calls)) { 453 454 spinlock_lock(&TASK->lock); 455 TASK->ipc_info.call_recieved++; 456 spinlock_unlock(&TASK->lock); 457 432 458 /* Handle requests */ 433 459 request = list_get_instance(box->calls.next, call_t, link); -
kernel/generic/src/proc/task.c
re43cdac ra307beb 187 187 ta->kcycles = 0; 188 188 189 ta->ipc_info.call_sent = 0; 190 ta->ipc_info.call_recieved = 0; 191 ta->ipc_info.answer_sent = 0; 192 ta->ipc_info.answer_recieved = 0; 193 ta->ipc_info.irq_notif_recieved = 0; 194 ta->ipc_info.forwarded = 0; 195 189 196 #ifdef CONFIG_UDEBUG 190 197 /* Init debugging stuff */ -
kernel/generic/src/ps/ps.c
re43cdac ra307beb 143 143 copy_to_uspace(&uspace_info->kcycles, &kcycles, sizeof(uint64_t)); 144 144 145 task_ipc_info_t ipc_info; 146 ipc_info.call_sent = t->ipc_info.call_sent; 147 ipc_info.call_recieved = t->ipc_info.call_recieved; 148 ipc_info.answer_sent = t->ipc_info.answer_sent; 149 ipc_info.answer_recieved = t->ipc_info.answer_recieved; 150 ipc_info.irq_notif_recieved = t->ipc_info.irq_notif_recieved; 151 ipc_info.forwarded = t->ipc_info.forwarded; 152 copy_to_uspace(&uspace_info->ipc_info, &ipc_info, sizeof(task_ipc_info_t)); 153 145 154 uint64_t memory = get_task_memory(t->as); 146 155 copy_to_uspace(&uspace_info->virt_mem, &memory, sizeof(memory));
Note:
See TracChangeset
for help on using the changeset viewer.