Changeset b678410 in mainline for uspace/app
- Timestamp:
- 2011-04-27T20:01:13Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a6dffb8
- Parents:
- 628d548 (diff), 933cadf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/app
- Files:
-
- 1 added
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
r628d548 rb678410 118 118 } 119 119 120 /* 121 * Mode "a" would be definitively much better here, but it is 122 * not well supported by the FAT driver. 123 */ 124 log = fopen(LOG_FNAME, "w"); 120 log = fopen(LOG_FNAME, "a"); 125 121 if (log == NULL) 126 122 printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME, -
uspace/app/stats/stats.c
r628d548 rb678410 69 69 size_t i; 70 70 for (i = 0; i < count; i++) { 71 uint64_t resmem, virtmem, ucycles, kcycles; 72 char resmem_suffix, virtmem_suffix, usuffix, ksuffix; 73 74 order_suffix(stats_tasks[i].resmem, &resmem, &resmem_suffix); 75 order_suffix(stats_tasks[i].virtmem, &virtmem, &virtmem_suffix); 71 uint64_t resmem; 72 uint64_t virtmem; 73 uint64_t ucycles; 74 uint64_t kcycles; 75 const char *resmem_suffix; 76 const char *virtmem_suffix; 77 char usuffix; 78 char ksuffix; 79 80 bin_order_suffix(stats_tasks[i].resmem, &resmem, &resmem_suffix, true); 81 bin_order_suffix(stats_tasks[i].virtmem, &virtmem, &virtmem_suffix, true); 76 82 order_suffix(stats_tasks[i].ucycles, &ucycles, &usuffix); 77 83 order_suffix(stats_tasks[i].kcycles, &kcycles, &ksuffix); 78 84 79 printf("%-8" PRIu64 " %7zu % 9" PRIu64 "%c %8" PRIu64 "%c"85 printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s %6" PRIu64 "%s" 80 86 " %8" PRIu64 "%c %8" PRIu64 "%c %s\n", 81 87 stats_tasks[i].task_id, stats_tasks[i].threads, … … 265 271 /* Threads */ 266 272 if ((off = arg_parse_short_long(argv[i], "-t", "--task=")) != -1) { 267 / * TODO: Support for 64b range */273 // TODO: Support for 64b range 268 274 int tmp; 269 275 int ret = arg_parse_int(argc, argv, &i, &tmp, off); -
uspace/app/tester/Makefile
r628d548 rb678410 49 49 loop/loop1.c \ 50 50 mm/malloc1.c \ 51 mm/malloc2.c \ 51 52 devs/devman1.c \ 52 53 hw/misc/virtchar1.c \ -
uspace/app/tester/mm/malloc2.c
r628d548 rb678410 1 1 /* 2 * Copyright (c) 2007 Jan Hudecek 3 * Copyright (c) 2008 Martin Decky 2 * Copyright (c) 2011 Jakub Jermar 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup genericproc 31 * @{ 32 */ 33 /** @file tasklet.h 34 * @brief Tasklets declarations 35 */ 29 #include <stdio.h> 30 #include <unistd.h> 31 #include <stdlib.h> 32 #include <malloc.h> 33 #include "../tester.h" 36 34 37 #ifndef KERN_TASKLET_H_ 38 #define KERN_TASKLET_H_ 35 const char *test_malloc2(void) 36 { 37 int cnt = 0; 38 char *p; 39 39 40 #include <adt/list.h> 40 TPRINTF("Provoking the kernel into overcommitting memory to us...\n"); 41 while ((p = malloc(1024 * 1024))) { 42 TPRINTF("%dM ", ++cnt); 43 *p = 'A'; 44 } 45 TPRINTF("\nWas refused more memory as expected.\n"); 41 46 42 /** Tasklet callback type */ 43 typedef void (* tasklet_callback_t)(void *arg); 44 45 /** Tasklet state */ 46 typedef enum { 47 NotActive, 48 Scheduled, 49 InProgress, 50 Disabled 51 } tasklet_state_t; 52 53 /** Structure describing a tasklet */ 54 typedef struct tasklet_descriptor { 55 link_t link; 56 57 /** Callback to call */ 58 tasklet_callback_t callback; 59 60 /** Argument passed to the callback */ 61 void *arg; 62 63 /** State of the tasklet */ 64 tasklet_state_t state; 65 } tasklet_descriptor_t; 66 67 68 extern void tasklet_init(void); 69 70 #endif 71 72 /** @} 73 */ 47 return NULL; 48 } -
uspace/app/tester/tester.c
r628d548 rb678410 62 62 #include "loop/loop1.def" 63 63 #include "mm/malloc1.def" 64 #include "mm/malloc2.def" 64 65 #include "hw/serial/serial1.def" 65 66 #include "hw/misc/virtchar1.def" -
uspace/app/tester/tester.h
r628d548 rb678410 78 78 extern const char *test_loop1(void); 79 79 extern const char *test_malloc1(void); 80 extern const char *test_malloc2(void); 80 81 extern const char *test_serial1(void); 81 82 extern const char *test_virtchar1(void); -
uspace/app/top/screen.c
r628d548 rb678410 254 254 uint64_t used; 255 255 uint64_t free; 256 c hartotal_suffix;257 c harunavail_suffix;258 c harused_suffix;259 c harfree_suffix;260 261 order_suffix(data->physmem->total, &total, &total_suffix);262 order_suffix(data->physmem->unavail, &unavail, &unavail_suffix);263 order_suffix(data->physmem->used, &used, &used_suffix);264 order_suffix(data->physmem->free, &free, &free_suffix);265 266 printf("memory: %" PRIu64 "% c total, %" PRIu64 "%cunavail, %"267 PRIu64 "% c used, %" PRIu64 "%cfree", total, total_suffix,256 const char *total_suffix; 257 const char *unavail_suffix; 258 const char *used_suffix; 259 const char *free_suffix; 260 261 bin_order_suffix(data->physmem->total, &total, &total_suffix, false); 262 bin_order_suffix(data->physmem->unavail, &unavail, &unavail_suffix, false); 263 bin_order_suffix(data->physmem->used, &used, &used_suffix, false); 264 bin_order_suffix(data->physmem->free, &free, &free_suffix, false); 265 266 printf("memory: %" PRIu64 "%s total, %" PRIu64 "%s unavail, %" 267 PRIu64 "%s used, %" PRIu64 "%s free", total, total_suffix, 268 268 unavail, unavail_suffix, used, used_suffix, free, free_suffix); 269 269 screen_newline(); … … 295 295 296 296 uint64_t resmem; 297 c harresmem_suffix;298 order_suffix(task->resmem, &resmem, &resmem_suffix);297 const char *resmem_suffix; 298 bin_order_suffix(task->resmem, &resmem, &resmem_suffix, true); 299 299 300 300 uint64_t virtmem; 301 c harvirtmem_suffix;302 order_suffix(task->virtmem, &virtmem, &virtmem_suffix);303 304 printf("%-8" PRIu64 " %7zu % 9" PRIu64 "%c",301 const char *virtmem_suffix; 302 bin_order_suffix(task->virtmem, &virtmem, &virtmem_suffix, true); 303 304 printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s ", 305 305 task->task_id, task->threads, resmem, resmem_suffix); 306 306 print_percent(perc->resmem, 2); 307 printf(" % 8" PRIu64 "%c", virtmem, virtmem_suffix);307 printf(" %6" PRIu64 "%s ", virtmem, virtmem_suffix); 308 308 print_percent(perc->virtmem, 2); 309 309 puts(" ");
Note:
See TracChangeset
for help on using the changeset viewer.