Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > System > Operating Systems > Kernels

    The LatSched Kernel Patch 2.5.0-0.3 / 2.5.1-pre11-0.5

    Download button

    No screenshots available
    Downloads: 582  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.9/5)
    14 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    LatSched Team | More programs
    GPL / FREE
    April 8th, 2008, 10:40 GMT
    ROOT / System / Operating Systems / Kernels

     Read user reviews (0)  Refer to a friend  Subscribe

    The LatSched Kernel Patch description

    The LatSched Kernel Patch is a kernel patch that enables a fine grained scheduler timing measurement.

    The LatSched Kernel Patch is a kernel patch that enables a fine grained scheduler timing measurement by using the kernel function get_cycles() that, on x86 cpu families, uses the rdtsc instruction to fetch the CPU cycle counter. A new character device /dev/latsched (MAJOR = 10 - MINOR = 117) has been introduced to control the behaviour and to fetch data from the kernel scheduler measure code. Other then measuring the scheduler latency this patch can be used to study process scheduling and migration between CPUs.

    To use the patch a new kernel must be built (with the patch applied) and the new character device /dev/latsched must be created with :

    # mknod /dev/latsched c 10 117

    The code that will make use of the LatSched patch must open the device with :

    if ((lsfd = open("/dev/latsched", O_RDWR)) == -1) {
    ...
    }

    The next step is to set the size of the sample ( circular ) buffer with :

    if ((res = ioctl(lsfd, LS_SAMPLES, samples))) {
    ...
    }

    Then the code will have to instruct to sampler to start collecting scheduler timings with :

    if ((res = ioctl(lsfd, LS_START, 0))) {
    ...
    }

    To stop the sampling process a new ioctl() call is necessary :

    if ((res = ioctl(lsfd, LS_STOP, 0))) {
    ...
    }

    At this point collected data is held inside the scheduler data buffers and must be fetched with something like this :

    int cpu, ncpus, ii;
    struct lsctl_getdata lsgd;

    ncpus = sysconf(_SC_NPROCESSORS_CONF);

    memset(&lsgd, 0, sizeof(lsgd));
    lsgd.size = samples;
    lsgd.data = (struct latsched_sample *) malloc(samples * sizeof(struct latsched_sample));

    for (cpu = 0; cpu < ncpus; cpu++) {
    lsgd.cpu = cpu;
    lsgd.size = samples;

    if ((res = ioctl(lsfd, LS_FETCH, &lsgd))) {
    ...
    }

    for (ii = 0; ii < lsgd.rsize; ii++) {
    ...
    }
    }


    Product's homepage

      


    TAGS:

    kernel patch | fine grained scheduler | linux kernel | linux | kernel | fine grained



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM