linux/lib/test_ref_tracker.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Reference tracker self test.
 *
 * Copyright (c) 2021 Eric Dumazet <[email protected]>
 */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/ref_tracker.h>
#include <linux/slab.h>
#include <linux/timer.h>

static struct ref_tracker_dir ref_dir;
static struct ref_tracker *tracker[20];

#define TRT_ALLOC

TRT_ALLOC(1)
TRT_ALLOC(2)
TRT_ALLOC(3)
TRT_ALLOC(4)
TRT_ALLOC(5)
TRT_ALLOC(6)
TRT_ALLOC(7)
TRT_ALLOC(8)
TRT_ALLOC(9)
TRT_ALLOC(10)
TRT_ALLOC(11)
TRT_ALLOC(12)
TRT_ALLOC(13)
TRT_ALLOC(14)
TRT_ALLOC(15)
TRT_ALLOC(16)
TRT_ALLOC(17)
TRT_ALLOC(18)
TRT_ALLOC(19)

#undef TRT_ALLOC

static noinline void
alloctest_ref_tracker_free(struct ref_tracker_dir *dir,
			   struct ref_tracker **trackerp)
{}


static struct timer_list test_ref_tracker_timer;
static atomic_t test_ref_timer_done =;

static void test_ref_tracker_timer_func(struct timer_list *t)
{}

static int __init test_ref_tracker_init(void)
{}

static void __exit test_ref_tracker_exit(void)
{}

module_init();
module_exit(test_ref_tracker_exit);

MODULE_DESCRIPTION();
MODULE_LICENSE();