Changeset a307beb in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2010-04-14T14:41:54Z (14 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bdfd3c97
Parents:
e43cdac
Message:

IPC statistics measured.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipc.c

    re43cdac ra307beb  
    219219        bool do_lock = ((!selflocked) || callerbox != (&TASK->answerbox));
    220220
     221        spinlock_lock(&TASK->lock);
     222        TASK->ipc_info.answer_sent++;
     223        spinlock_unlock(&TASK->lock);
     224
    221225        call->flags |= IPC_CALL_ANSWERED;
    222226
     
    276280static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call)
    277281{
     282        spinlock_lock(&TASK->lock);
     283        TASK->ipc_info.call_sent++;
     284        spinlock_unlock(&TASK->lock);
     285
    278286        if (!(call->flags & IPC_CALL_FORWARDED)) {
    279287                atomic_inc(&phone->active_calls);
     
    376384int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, int mode)
    377385{
     386        spinlock_lock(&TASK->lock);
     387        TASK->ipc_info.forwarded++;
     388        spinlock_unlock(&TASK->lock);
     389
    378390        spinlock_lock(&oldbox->lock);
    379391        list_remove(&call->link);
     
    416428        spinlock_lock(&box->lock);
    417429        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
    418435                ipl = interrupts_disable();
    419436                spinlock_lock(&box->irq_lock);
     
    425442                interrupts_restore(ipl);
    426443        } else if (!list_empty(&box->answers)) {
     444                spinlock_lock(&TASK->lock);
     445                TASK->ipc_info.answer_recieved++;
     446                spinlock_unlock(&TASK->lock);
     447
    427448                /* Handle asynchronous answers */
    428449                request = list_get_instance(box->answers.next, call_t, link);
     
    430451                atomic_dec(&request->data.phone->active_calls);
    431452        } else if (!list_empty(&box->calls)) {
     453
     454                spinlock_lock(&TASK->lock);
     455                TASK->ipc_info.call_recieved++;
     456                spinlock_unlock(&TASK->lock);
     457
    432458                /* Handle requests */
    433459                request = list_get_instance(box->calls.next, call_t, link);
Note: See TracChangeset for help on using the changeset viewer.