Re: [PATCH] rtla: Define _GNU_SOURCE in timerlat_bpf.c

From: Tomas Glozar
Date: Mon May 19 2025 - 02:21:16 EST


so 17. 5. 2025 v 0:22 odesílatel John Kacur <jkacur@xxxxxxxxxx> napsal:
> Question for Tomas, should we spend sometime to make this work for older
> versions of glibc without a definition of struct sched_attr?

Older versions of glibc without a definition for struct sched_attr use
the one in utils.h:

#ifndef SCHED_ATTR_SIZE_VER0
struct sched_attr {
uint32_t size;
uint32_t sched_policy;
uint64_t sched_flags;
int32_t sched_nice;
uint32_t sched_priority;
uint64_t sched_runtime;
uint64_t sched_deadline;
uint64_t sched_period;
};
#endif /* SCHED_ATTR_SIZE_VER0 */

In fact, this one works fine in timerlat_bpf.c, if you build rtla on
older glibc, it will work even without this patch. It's the glibc one
which is not defined without _GNU_SOURCE.

Tomas