This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/module.h> | |
#include <linux/lglock.h> | |
#include <linux/percpu-rwlock.h> | |
#include <linux/sched.h> | |
DEFINE_STATIC_LGRWLOCK(test_lgrw); | |
DEFINE_STATIC_PERCPU_RWLOCK(test_percpu_rwlock); | |
static DEFINE_RWLOCK(test_rwlock); | |
#define TEST_COUNT 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
void main(void) { | |
int pid = getpid(); | |
char *cmd; | |
// asprintf(&cmd, "cat /proc/%d/maps", pid); |