Author Topic: [GNU/Linux] looking for a iotop-like program but written in pure C  (Read 3005 times)

0 Members and 1 Guest are viewing this topic.

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
iotop is written in Python, which I cannot support on my embedded router.

looking for an alternative, written in C.

is there anything?  :-//

before I start writing by myself
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #1 on: March 13, 2023, 12:01:39 am »
https://github.com/Tomas-M/iotop
Quote
Inspired by iotop Python script from Guillaume Chazarain, rewritten in C by Vyacheslav Trushkin and improved by Boian Bonev so it runs without Python at all.
 
The following users thanked this post: DiTBho

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #2 on: March 13, 2023, 12:53:14 am »
https://github.com/Tomas-M/iotop
Quote
Inspired by iotop Python script from Guillaume Chazarain, rewritten in C by Vyacheslav Trushkin and improved by Boian Bonev so it runs without Python at all.

thanks!
have you already tried it?

Going to add it to the new Catalyst-stage4 profile ;D
it will be tested next week!
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #3 on: March 13, 2023, 01:14:53 am »
Yes, just compiled it and tried on Arch Linux.
It seems to work fine so far.
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #4 on: March 17, 2023, 10:16:47 am »
so, iotop-c compiled on different machines, and

1) it perfectly works on my PC, i686-GNU-Linux
2) it doesn't correctly work on my router, MIPS32/LE-GNU-Linux

reports are always zero, and something triggers prIO to fail with an error

Code: [Select]
struct xxxid_stats *ms=cs->sor[i],*s;
...
                        if (!config.f.hideprio)
                        {
                                char c=' ';

                                if (k==-1&&th_prio_diff)
                                {
                                        c='!';
                                }
                                if (s->error_i) <---------------- something triggers this
                                {
                                        attron(config.f.nocolor?A_ITALIC:COLOR_PAIR(RED_PAIR));
                                        printw("tp_#1 ");
                                        attroff(config.f.nocolor?A_ITALIC:COLOR_PAIR(RED_PAIR));
                                }
                                else
                                {
                                        printw("%c%4s ",c,str_ioprio(s->io_prio));
                                }
                        }
(src/view_curses.c)

The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #5 on: March 17, 2023, 07:55:45 pm »
I don't know how active the author is, but you should open a ticket on github with this.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6266
  • Country: fi
    • My home page and email address
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #6 on: March 17, 2023, 10:43:55 pm »
Could you try running the following program, as shown on the third line (if you save it as this.c)?
Code: [Select]
// Spdx-License-Identifier: CC0-1.0
//
// gcc -Wall -O2 this.c -o showioprio && ./showioprio $(cd /proc && /bin/ls -1d [1-9]* | tr -d /) | sort -n

#define  _GNU_SOURCE
#define  _POSIX_C_SOURCE  200809L
#include <stdlib.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/resource.h>
#include <sched.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>

int report(pid_t p)
{
    errno = 0;
    long  val = syscall(SYS_ioprio_get, /*IOPRIO_WHO_PROCESS*/ 1, (int)p);
    if (errno) {
        if (errno == ESRCH) {
            fprintf(stderr, "%d: No such process.\n", (int)p);
            return 0;
        } else {
            fprintf(stderr, "%d: ioprio_get syscall failed: %s.\n", (int)p, strerror(errno));
            return -1;
        }
    }

    long  c = val >> 13;
    if (c == 0) {
        errno = 0;

        int  n = getpriority(PRIO_PROCESS, p);
        if (errno) {
            fprintf(stderr, "%d: getpriority() failed: %s.\n", (int)p, strerror(errno));
            return -1;
        }
        if (n < -20 || n > 19) {
            fprintf(stderr, "%d: getpriority() returned an invalid scheduling priority, %d.\n", (int)p, n);
            return -1;
        }
        int  v = (n + 20) / 5;  /* Specified as the mapping between scheduling priority and IO priority */

        int  s = sched_getscheduler(p);
        switch (s & 0x3FFFFFFF) {
        case -1:
            fprintf(stderr, "%d: sched_getscheduler() failed: %s.\n", (int)p, strerror(errno));
            return -1;

        case SCHED_FIFO:
        case SCHED_RR:
        case SCHED_DEADLINE:
            printf("%d: Realtime %d (default)\n", (int)p, v);
            break;

        case SCHED_IDLE:
            printf("%d: Idle %d (default)\n", (int)p, v);
            break;

        default:
            printf("%d: Best-effort %d (default)\n", (int)p, v);
            break;
        }
        fflush(stdout);
        return 0;

    } else {
        int  v = val & 0x1FFF;

        if (v < 0 || v > 7) {
            printf("%d: Unknown ioprio 0x%lx\n", (int)p, (unsigned long)val);
            fflush(stdout);
            return -1;
        }

        switch (c) {
        case 1:  printf("%d: Realtime %d\n", (int)p, v);
                 break;
        case 2:  printf("%d: Best-effort %d\n", (int)p, v);
                 break;
        case 3:  printf("%d: Idle %d\n", (int)p, v);
                 break;
        default: fprintf(stderr, "%d: Unknown ioprio 0x%lx\n", (int)p, (unsigned long)val);
                 return -1;
        }

        fflush(stdout);
        return 0;
    }
}

int parse_pid(const char *src, pid_t *to)
{
    const char *end;
    long        val;

    if (!src || !*src)
        return errno = EINVAL;

    errno = 0;
    end = src;
    val = strtol(src, (char **)(&end), 0);
    if (errno)
        return errno;
    if (src == end || *end || (long)((pid_t)val) != val)
        return errno = EINVAL;

    if (to)
        *to = (pid_t)val;

    return 0;
}

int main(int argc, char *argv[])
{
    pid_t p;

    if (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) {
        fprintf(stderr, "\n");
        fprintf(stderr, "Usage: %s -h | --help\n", argv[0]);
        fprintf(stderr, "       %s PID [ PID ... ]\n", argv[0]);
        fprintf(stderr, "\n");
        fprintf(stderr, "This reports the IO class and priority for the specified process or processes.\n");
        fprintf(stderr, "\n");
    }

    if (argc < 2) {
        if (report(getpid()))
            return EXIT_FAILURE;
        return EXIT_SUCCESS;
    }

    for (int arg = 1; arg < argc; arg++) {
        if (parse_pid(argv[arg], &p) || p < 1) {
            fprintf(stderr, "%s: Invalid process ID: %s.\n", argv[arg], strerror(errno));
            return EXIT_FAILURE;
        }
        if (report(p))
            return EXIT_FAILURE;
        fflush(stdout);
    }

    return EXIT_SUCCESS;
}
It uses the same logic as the current kernel (as of 2023-03-17): class zero indicates I/O priority is derived from CPU priority via (nice+20)/5 (in which case the value part is irrelevant); if CPU scheduling policy is SCHED_IDLE, then the I/O priority class is idle also; if SCHED_FIFO, SCHED_RR, or SCHED_DEADLINE, then the I/O priority class is realtime; otherwise the I/O priority class is best effort.

All processes running on my desktop machine report one of
    Best-effort 0 (default)
    Best-effort 1 (default)
    Best-effort 2 (default)
    Best-effort 3
    Best-effort 3 (default)
    Best-effort 4 (default)
    Best-effort 5 (default)
    Best-effort 7 (default)
    Realtime 4 (default)
where the (default) just denotes that the I/O priority was not set explicitly, but was inherited from the default CPU priority as mentioned above.

Running the example command it is normal for it to report three or so PIDs as not existing, because they have been reaped before the example program runs.
Any error messages output to standard error would be interesting; I only get three "No such process." ones.
In particular, check out for "Function not implemented" and "Operation not supported" errors.
 
The following users thanked this post: DiTBho

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #7 on: March 17, 2023, 11:05:50 pm »
Just remembered that it requires elevated rights to work properly. So check that it runs with proper rights on your router, which I suspect it doesn't.
Quoting from the output of iotop (it doesn't seem to be documented in the main README of the project, which I think has been overlooked.)
Quote
The Linux kernel interfaces that iotop relies on now require root privileges
or the NET_ADMIN capability. This change occurred because a security issue
(CVE-2011-2494) was found that allows leakage of sensitive data across user
boundaries. If you require the ability to run iotop as a non-root user, please
configure sudo to allow you to run iotop as root.

Alternatively to using sudo the NET_ADMIN capability can be set by

   $ sudo setcap 'cap_net_admin+eip' <path-to>/iotop

Be warned that this will also allow other users to run it and get access to
information that normally should not be available to them.

Please do not file bugs on iotop about this.
 
The following users thanked this post: DiTBho

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6266
  • Country: fi
    • My home page and email address
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #8 on: March 17, 2023, 11:51:26 pm »
Note that iotop only sets the error_i member in one place, in src/xxxid_info.c:make_stats(), and only when src/ioprio.c:get_ioprio() returns -1.  And it can only return -1 if syscall(SYS_ioprio_get, ...) returns an error (-1, in which case errno is set to the error, but not reported by iotop).

If it is a permission issue, my test program will complain "PID: ioprio_get syscall failed: Permission denied".

FWIW, I'm running a 5.4.0 kernel, and it does not require privileges for the priority information, although security modules can change that.  Other stuff in iotop, specifically taskstats netlink does, require NET_ADMIN.

 
The following users thanked this post: DiTBho

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #9 on: March 18, 2023, 10:50:37 am »
Could you try running the following program, as shown on the third line (if you save it as this.c)?

renamed test.c as showioprio.c, added Makefile

Code: [Select]
# make
showioprio.c: In function 'report':
showioprio.c:51: error: 'SCHED_DEADLINE' undeclared (first use in this function)
showioprio.c:51: error: (Each undeclared identifier is reported only once
showioprio.c:51: error: for each function it appears in.)
showioprio.c:55: error: 'SCHED_IDLE' undeclared (first use in this function)
showioprio.c: In function 'main':
showioprio.c:132: error: 'for' loop initial declaration used outside C99 mode
make: *** [all] Error 1

{ SCHED_DEADLINE, SCHED_IDLE } undeclared  :-//

running kernel v6.2.0, I have already updated all the linux-headers files
Code: [Select]
[ U ] sys-kernel/linux-headers-5.4-r99 [2.6.27-r2]
but it didn't help
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #10 on: March 18, 2023, 10:52:04 am »
Just remembered that it requires elevated rights to work properly. So check that it runs with proper rights on your router, which I suspect it doesn't.

runs as UID=0 (root)
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #11 on: March 18, 2023, 11:00:26 am »
Code: [Select]
#define  _GNU_SOURCE
#define  _POSIX_C_SOURCE    200809L
#include <stdlib.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/resource.h>
#include <sched.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>

int report
(
    pid_t p
)
{
    errno = 0;
    long val = syscall(SYS_ioprio_get, /*IOPRIO_WHO_PROCESS*/ 1, (int) p);
    if (errno)
    {
        if (errno == ESRCH)
        {
            fprintf(stderr, "%d: No such process.\n", (int) p);
            return 0;
        }
        else
        {
            fprintf(stderr, "%d: ioprio_get syscall failed: %s.\n", (int) p, strerror(errno));
            return -1;
        }
    }

    long c = val >> 13;
    if (c == 0)
    {
        errno = 0;

        int n = getpriority(PRIO_PROCESS, p);
        if (errno)
        {
            fprintf(stderr, "%d: getpriority() failed: %s.\n", (int) p, strerror(errno));
            return -1;
        }
        if (n < -20 || n > 19)
        {
            fprintf(stderr, "%d: getpriority() returned an invalid scheduling priority, %d.\n", (int) p, n);
            return -1;
        }
        int v = (n + 20) / 5;   /* Specified as the mapping between scheduling priority and IO priority */

        int s = sched_getscheduler(p);
        switch (s & 0x3FFFFFFF)
        {
        case -1:
            fprintf(stderr, "%d: sched_getscheduler() failed: %s.\n", (int) p, strerror(errno));
            return -1;

//        case SCHED_FIFO:
//        case SCHED_RR:
//        case SCHED_DEADLINE:
//            printf("%d: Realtime %d (default)\n", (int)p, v);
//            break;
//
//        case SCHED_IDLE:
//            printf("%d: Idle %d (default)\n", (int)p, v);
//            break;

        default:
            printf("%d: Best-effort %d (default)\n", (int) p, v);
            break;
        }
        fflush(stdout);
        return 0;
    }
    else
    {
        int v = val & 0x1FFF;

        if (v < 0 || v > 7)
        {
            printf("%d: Unknown ioprio 0x%lx\n", (int) p, (unsigned long) val);
            fflush(stdout);
            return -1;
        }

        switch (c)
        {
        case 1:  printf("%d: Realtime %d\n", (int) p, v);
            break;
        case 2:  printf("%d: Best-effort %d\n", (int) p, v);
            break;
        case 3:  printf("%d: Idle %d\n", (int) p, v);
            break;
        default: fprintf(stderr, "%d: Unknown ioprio 0x%lx\n", (int) p, (unsigned long) val);
            return -1;
        }

        fflush(stdout);
        return 0;
    }
}

int parse_pid
(
    char *src,
    pid_t *to
)
{
    char *end;
    long val;

    if (!src || !*src)
    {
        return errno = EINVAL;
    }

    errno = 0;
    end   = src;
    val   = strtol(src, (char * *) (&end), 0);
    if (errno)
    {
        return errno;
    }
    if (src == end || *end || (long) ((pid_t) val) != val)
    {
        return errno = EINVAL;
    }

    if (to)
    {
        *to = (pid_t) val;
    }

    return 0;
}

int main
(
    int argc,
    char *argv[]
)
{
    pid_t p;
    int   arg;

    if (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
    {
        fprintf(stderr, "\n");
        fprintf(stderr, "Usage: %s -h | --help\n", argv[0]);
        fprintf(stderr, "       %s PID [ PID ... ]\n", argv[0]);
        fprintf(stderr, "\n");
        fprintf(stderr, "This reports the IO class and priority for the specified process or processes.\n");
        fprintf(stderr, "\n");
    }

    if (argc < 2)
    {
        if (report(getpid()))
        {
            return EXIT_FAILURE;
        }
        return EXIT_SUCCESS;
    }

    for (arg = 1; arg < argc; arg++)
    {
        if (parse_pid(argv[arg], &p) || p < 1)
        {
            fprintf(stderr, "%s: Invalid process ID: %s.\n", argv[arg], strerror(errno));
            return EXIT_FAILURE;
        }
        if (report(p))
        {
            return EXIT_FAILURE;
        }
        fflush(stdout);
    }

    return EXIT_SUCCESS;
}

commenting some lines, it compiles and reports something interesting
Code: [Select]
16533: ioprio_get syscall failed: Function not implemented.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #12 on: March 18, 2023, 11:30:04 am »
is it glibc?

tried on
  • MacMini-G4 with sys-libs/glibc-v2.11.2 (~2009): ioprio_get syscall success
  • Mips32r2 router with sys-libs/glibc-v2.9 (~2008): ioprio_get syscall failed: Function not implemented
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #13 on: March 18, 2023, 11:47:54 am »
Code: [Select]
- #include <sched.h>
+ #include <linux/sched.h>

still it fails, but this way it compiles

- - -

Code: [Select]
...
/*
 * Scheduling policies
 */
#define SCHED_NORMAL            0
#define SCHED_FIFO              1
#define SCHED_RR                2
#define SCHED_BATCH             3
/* SCHED_ISO: reserved but not implemented yet */
#define SCHED_IDLE              5
#define SCHED_DEADLINE          6
...
/usr/include/linux/sched.h -> sys-kernel/linux-headers-5.4-r99, defines SCHED_*

/usr/include/sched.h -> sys-libs/glibc-2.9, doesn't define SCHED_*


so *is* "linux/sched.h" correct?  :-//
« Last Edit: March 18, 2023, 03:47:47 pm by DiTBho »
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6266
  • Country: fi
    • My home page and email address
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #14 on: March 18, 2023, 03:13:46 pm »
16533: ioprio_get syscall failed: Function not implemented.
Your kernel does not have any I/O schedulers.  This is perfectly normal if you have CONFIG_BLOCK=n, i.e. a kernel without support for block devices.

The ioprio_get() syscall is implemented in block/ioprio.c:SYSCALL_DEFINE2(ioprio_get, ...), which AFAIK is implemented iff CONFIG_BLOCK=y or =m.
 
The following users thanked this post: SiliconWizard, DiTBho

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #15 on: March 18, 2023, 03:47:13 pm »
Code: [Select]
...
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
# CONFIG_MODULES is not set
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_ICQ=y
...

weird, because this is the config  :o :o :o
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #16 on: March 18, 2023, 07:09:21 pm »
Code: [Select]
# cat /sys/block/sda/queue/scheduler
none [mq-deadline] kyber bfq

 :-//
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #17 on: March 18, 2023, 07:25:09 pm »
so, if it's not glibc ...

Code: [Select]
cat /proc/kallsyms | grep ioprio_get
80354c3c T sys_ioprio_get
80354c3c T __se_sys_ioprio_get
(added debug-symbols, recompiled)

I am perplexed ... ioprio_get is there, but the userspace doesn't see it  :-//
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #18 on: March 18, 2023, 08:57:42 pm »
Code: [Select]
#include <stdio.h>
#include <sys/syscall.h>
#include <errno.h>
#include <string.h>


void test
(
    long arg
)
{
    int ret;

    ret = syscall(arg);

    printf("syscall(%ld) = %d (%s)\n", arg, ret, strerror(errno));
}

int main()
{
    long i0;

    for (i0 = 1; i0 < 1000; i0++)
    {
        test(i0);
    }

    return 0;
}

wrote this program: all the system calls "syscall" failed!

it seems syscall() is not working at all  :-//
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #19 on: March 18, 2023, 09:00:11 pm »
syscall fails with what error? Always the same?
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #20 on: March 18, 2023, 09:05:37 pm »
syscall fails with what error? Always the same?

Code: [Select]
syscall(1) = -1 (Function not implemented)
syscall(2) = -1 (Function not implemented)
syscall(3) = -1 (Function not implemented)
syscall(4) = -1 (Function not implemented)
syscall(5) = -1 (Function not implemented)
syscall(6) = -1 (Function not implemented)
syscall(7) = -1 (Function not implemented)
syscall(8) = -1 (Function not implemented)
syscall(9) = -1 (Function not implemented)
syscall(10) = -1 (Function not implemented)
...
syscall(999) = -1 (Function not implemented)
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #21 on: March 18, 2023, 09:14:48 pm »
Can you have a look at the /sys/kernel/debug/tracing/events/syscalls directory?

Code: [Select]
sudo ls /sys/kernel/debug/tracing/events/syscalls(sudo is not necessary if it's running as root.)
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #22 on: March 18, 2023, 09:37:55 pm »
/sys/kernel/debug/ is empty
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #23 on: March 19, 2023, 12:36:19 am »
Unless you can find an obvious cause for your issue, having access to kernel debug would be a nice help.

If this directory is empty, that probably means the kernel was not built with the CONFIG_DYNAMIC_DEBUG config flag. Can you rebuild it with this flag enabled?
 

Offline DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: [GNU/Linux] looking for a iotop-like program but written in pure C
« Reply #24 on: March 19, 2023, 12:41:36 am »
Unless you can find an obvious cause for your issue, having access to kernel debug would be a nice help.

If this directory is empty, that probably means the kernel was not built with the CONFIG_DYNAMIC_DEBUG config flag. Can you rebuild it with this flag enabled?

already built with that  :-//

Code: [Select]
#
# printk and dmesg options
#
# CONFIG_PRINTK_TIME is not set
# CONFIG_PRINTK_CALLER is not set
# CONFIG_STACKTRACE_BUILD_ID is not set
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
CONFIG_CONSOLE_LOGLEVEL_QUIET=15
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y
CONFIG_SYMBOLIC_ERRNAME=y
# end of printk and dmesg options

CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_MISC is not set
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf