Changeset 577f042a in mainline
- Timestamp:
- 2011-01-27T17:57:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5378f99
- Parents:
- 875c629
- Location:
- kernel/generic/src/proc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
r875c629 r577f042a 342 342 sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len) 343 343 { 344 int rc;345 344 char namebuf[TASK_NAME_BUFLEN]; 346 345 347 346 /* Cap length of name and copy it from userspace. */ 348 349 347 if (name_len > TASK_NAME_BUFLEN - 1) 350 348 name_len = TASK_NAME_BUFLEN - 1; 351 349 352 rc = copy_from_uspace(namebuf, uspace_name, name_len);350 int rc = copy_from_uspace(namebuf, uspace_name, name_len); 353 351 if (rc != 0) 354 352 return (sysarg_t) rc; 355 353 356 354 namebuf[name_len] = '\0'; 355 356 /* 357 * As the task name is referenced also from the 358 * threads, lock the threads' lock for the course 359 * of the update. 360 */ 361 362 irq_spinlock_lock(&tasks_lock, true); 363 irq_spinlock_lock(&TASK->lock, false); 364 irq_spinlock_lock(&threads_lock, false); 365 366 /* Set task name */ 357 367 str_cpy(TASK->name, TASK_NAME_BUFLEN, namebuf); 368 369 irq_spinlock_unlock(&threads_lock, false); 370 irq_spinlock_unlock(&TASK->lock, false); 371 irq_spinlock_unlock(&tasks_lock, true); 358 372 359 373 return EOK; -
kernel/generic/src/proc/thread.c
r875c629 r577f042a 591 591 order_suffix(thread->kcycles, &kcycles, &ksuffix); 592 592 593 char *name; 594 if (str_cmp(thread->name, "uinit") == 0) 595 name = thread->task->name; 596 else 597 name = thread->name; 598 593 599 #ifdef __32_BITS__ 594 600 if (*additional) 595 printf("%-8 " PRIu64" %10p %9" PRIu64 "%c %9" PRIu64 "%c ",596 thread->tid, thread-> kstack, ucycles, usuffix,597 kcycles, ksuffix);601 printf("%-8 %10p" PRIu64" %10p %9" PRIu64 "%c %9" PRIu64 "%c ", 602 thread->tid, thread->thread_code, thread->kstack, 603 ucycles, usuffix, kcycles, ksuffix); 598 604 else 599 printf("%-8" PRIu64" %-14s %10p %-8s %10p %-5" PRIu32 " %10p\n",600 thread->tid, thread->name, thread, thread_states[thread->state],605 printf("%-8" PRIu64" %-14s %10p %-8s %10p %-5" PRIu32 "\n", 606 thread->tid, name, thread, thread_states[thread->state], 601 607 thread->task, thread->task->context, thread->thread_code); 602 608 #endif … … 610 616 else 611 617 printf("%-8" PRIu64" %-14s %18p %-8s %18p %-5" PRIu32 "\n", 612 thread->tid, thread->name, thread, thread_states[thread->state],618 thread->tid, name, thread, thread_states[thread->state], 613 619 thread->task, thread->task->context); 614 620 #endif … … 648 654 #ifdef __32_BITS__ 649 655 if (additional) 650 printf("[id ] [ stack ] [ucycles ] [kcycles ] [cpu]"651 " [ waitqueue]\n");656 printf("[id ] [code ] [stack ] [ucycles ] [kcycles ]" 657 " [cpu] [waitqueue]\n"); 652 658 else 653 659 printf("[id ] [name ] [address ] [state ] [task ]" 654 " [ctx] [code ]\n");660 " [ctx]\n"); 655 661 #endif 656 662
Note:
See TracChangeset
for help on using the changeset viewer.