Changeset b678410 in mainline for uspace/app


Ignore:
Timestamp:
2011-04-27T20:01:13Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
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.
Message:

Merge mainline changes.

Location:
uspace/app
Files:
1 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/klog/klog.c

    r628d548 rb678410  
    118118        }
    119119       
    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");
    125121        if (log == NULL)
    126122                printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME,
  • uspace/app/stats/stats.c

    r628d548 rb678410  
    6969        size_t i;
    7070        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);
    7682                order_suffix(stats_tasks[i].ucycles, &ucycles, &usuffix);
    7783                order_suffix(stats_tasks[i].kcycles, &kcycles, &ksuffix);
    7884               
    79                 printf("%-8" PRIu64 " %7zu %9" PRIu64 "%c %8" PRIu64 "%c"
     85                printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s %6" PRIu64 "%s"
    8086                    " %8" PRIu64 "%c %8" PRIu64 "%c %s\n",
    8187                    stats_tasks[i].task_id, stats_tasks[i].threads,
     
    265271                /* Threads */
    266272                if ((off = arg_parse_short_long(argv[i], "-t", "--task=")) != -1) {
    267                         /* TODO: Support for 64b range */
     273                        // TODO: Support for 64b range
    268274                        int tmp;
    269275                        int ret = arg_parse_int(argc, argv, &i, &tmp, off);
  • uspace/app/tester/Makefile

    r628d548 rb678410  
    4949        loop/loop1.c \
    5050        mm/malloc1.c \
     51        mm/malloc2.c \
    5152        devs/devman1.c \
    5253        hw/misc/virtchar1.c \
  • uspace/app/tester/mm/malloc2.c

    r628d548 rb678410  
    11/*
    2  * Copyright (c) 2007 Jan Hudecek
    3  * Copyright (c) 2008 Martin Decky
     2 * Copyright (c) 2011 Jakub Jermar
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    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"
    3634
    37 #ifndef KERN_TASKLET_H_
    38 #define KERN_TASKLET_H_
     35const char *test_malloc2(void)
     36{
     37        int cnt = 0;
     38        char *p;
    3939
    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");
    4146
    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  
    6262#include "loop/loop1.def"
    6363#include "mm/malloc1.def"
     64#include "mm/malloc2.def"
    6465#include "hw/serial/serial1.def"
    6566#include "hw/misc/virtchar1.def"
  • uspace/app/tester/tester.h

    r628d548 rb678410  
    7878extern const char *test_loop1(void);
    7979extern const char *test_malloc1(void);
     80extern const char *test_malloc2(void);
    8081extern const char *test_serial1(void);
    8182extern const char *test_virtchar1(void);
  • uspace/app/top/screen.c

    r628d548 rb678410  
    254254        uint64_t used;
    255255        uint64_t free;
    256         char total_suffix;
    257         char unavail_suffix;
    258         char used_suffix;
    259         char free_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 "%c unavail, %"
    267             PRIu64 "%c used, %" PRIu64 "%c free", 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,
    268268            unavail, unavail_suffix, used, used_suffix, free, free_suffix);
    269269        screen_newline();
     
    295295               
    296296                uint64_t resmem;
    297                 char resmem_suffix;
    298                 order_suffix(task->resmem, &resmem, &resmem_suffix);
     297                const char *resmem_suffix;
     298                bin_order_suffix(task->resmem, &resmem, &resmem_suffix, true);
    299299               
    300300                uint64_t virtmem;
    301                 char virtmem_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 ",
    305305                    task->task_id, task->threads, resmem, resmem_suffix);
    306306                print_percent(perc->resmem, 2);
    307                 printf(" %8" PRIu64 "%c ", virtmem, virtmem_suffix);
     307                printf(" %6" PRIu64 "%s ", virtmem, virtmem_suffix);
    308308                print_percent(perc->virtmem, 2);
    309309                puts(" ");
Note: See TracChangeset for help on using the changeset viewer.