[Tracker] Building the current cvs version.



Hi

Been on my todo list to implement ionice support for tracker for a while, since it's such a simple thing to do. But I'm having some problems building the current version.

First when building I'm missing the directories thumbnailers/image and src/tracker-gui.

And when taking that out I get the error:
aclocal: macro `AM_PROG_MKDIR_P' required but not defined
aclocal: macro `AM_PROG_MKDIR_P' required but not defined
in the libextractor directory.

Attaching a theoretically working implementation of ionice. trackerd.c would have to run the ionice_init() function. I would have tested it and made it a bit cleaner if I could get the cvs version compiled at all :P

Most of the code for ionice is gotten from the snippet in the Documentation/block/ioprio.txt file in the linux kernel.

Anders Aagaard
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <asm/unistd.h>

extern int sys_ioprio_set(int, int, int);
extern int sys_ioprio_get(int, int);

#if defined(__i386__)
#define __NR_ioprio_set         289
#define __NR_ioprio_get         290
#elif defined(__ppc__)
#define __NR_ioprio_set         273
#define __NR_ioprio_get         274
#elif defined(__x86_64__)
#define __NR_ioprio_set         251
#define __NR_ioprio_get         252
#elif defined(__ia64__)
#define __NR_ioprio_set         1274
#define __NR_ioprio_get         1275
#else
#define NO_IOPRIO
#endif

#ifndef NO_IOPRIO
_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
_syscall2(int, ioprio_get, int, which, int, who);

enum {
        IOPRIO_CLASS_NONE,
        IOPRIO_CLASS_RT,
        IOPRIO_CLASS_BE,
        IOPRIO_CLASS_IDLE,
};

enum {
        IOPRIO_WHO_PROCESS = 1,
        IOPRIO_WHO_PGRP,
        IOPRIO_WHO_USER,
};

#endif
void ionice_init()
{
#ifndef NO_IOPRIO
        int ioprio = 7, ioprio_class = IOPRIO_CLASS_BE;
        // Setting us to best effort, priority 7.  Could also consider IOPRIO_CLASS_IDLE.
        if (ioprio_set(IOPRIO_WHO_PROCESS, 0, ioprio | ioprio_class << IOPRIO_CLASS_SHIFT) == -1) {
                        tracker_log("ioprio_set error.");
                        return 1;
        }
#endif
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]