aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/autoload.c
blob: 3693f7d133eb0082fe3c72e2c43dfc40b4be5fb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */

#include <test_progs.h>
#include <time.h>
#include "test_autoload.skel.h"

void test_autoload(void)
{
	int duration = 0, err;
	struct test_autoload* skel;

	skel = test_autoload__open_and_load();
	/* prog3 should be broken */
	if (CHECK(skel, "skel_open_and_load", "unexpected success\n"))
		goto cleanup;

	skel = test_autoload__open();
	if (CHECK(!skel, "skel_open", "failed to open skeleton\n"))
		goto cleanup;

	/* don't load prog3 */
	bpf_program__set_autoload(skel->progs.prog3, false);

	err = test_autoload__load(skel);
	if (CHECK(err, "skel_load", "failed to load skeleton: %d\n", err))
		goto cleanup;

	err = test_autoload__attach(skel);
	if (CHECK(err, "skel_attach", "skeleton attach failed: %d\n", err))
		goto cleanup;

	usleep(1);

	CHECK(!skel->bss->prog1_called, "prog1", "not called\n");
	CHECK(!skel->bss->prog2_called, "prog2", "not called\n");
	CHECK(skel->bss->prog3_called, "prog3", "called?!\n");

cleanup:
	test_autoload__destroy(skel);
}
explaining the non-obviousAndreas Gruenbacher1-8/+2 2010-01-09base85: encode_85() does not use the decode tableAndreas Gruenbacher1-2/+0 2010-01-09base85 debug code: Fix length byte calculationAndreas Gruenbacher1-1/+1 2010-01-09Documentation: tiny git config manual tweaksJonathan Nieder1-4/+4 2010-01-09Documentation: git gc packs refs by default nowJonathan Nieder1-9/+6 2010-01-07Describe second batch for 1.7.0 in draft release notesJunio C Hamano1-1/+7 2010-01-07git-rm doc: Describe how to sync index & work treeBjörn Gustavsson1-1/+53 2010-01-06checkout -m: do not try to fall back to --merge from an unborn branchJunio C Hamano1-2/+8 2010-01-06t7002: test for not using external grep on skip-worktree pathsNguyễn Thái Ngọc Duy2-0/+13 2010-01-06t7002: set test prerequisite "external-grep" if supportedNguyễn Thái Ngọc Duy1-0/+12 2010-01-06.gitattributes: detect 8-space indent in shell scriptsJunio C Hamano1-0/+1 2010-01-05Makefile: make ppc/sha1ppc.o depend on GIT-CFLAGSJonathan Nieder1-1/+1 2010-01-03Use warning function instead of fprintf(stderr, "Warning: ...").Thiago Farina4-7/+5 2010-01-02stash: mention --patch in usage string.Matthieu Moy1-1/+1 2009-12-31branch: die explicitly why when calling "git branch [-a|-r] branchname".Matthieu Moy2-15/+17 2009-12-31fast-import: Document author/committer/tagger name is optionalShawn O. Pearce2-6/+6 2009-12-31SubmittingPatches: hints to know the status of a submitted patch.Matthieu Moy1-0/+14 2009-12-31bash completion: factor submodules into dirty stateThomas Rast1-4/+2 2009-12-31Fix "git remote update" with remotes.defalt setBjörn Gustavsson2-6/+18 2009-12-31builtin-config: add --path option doing ~ and ~user expansion.Matthieu Moy3-4/+58 2009-12-31cvsserver: make the output of 'update' more compatible with cvs.Sergei Organov1-0/+16 2009-12-30bash completion: add space between branch name and status flagsShawn O. Pearce1-5/+2 2009-12-30grep: do not do external grep on skip-worktree entriesNguyễn Thái Ngọc Duy1-1/+17 2009-12-30CVS Server: Support reading base and roots from environmentPhil Miller2-1/+36 2009-12-30builtin-push: add --delete as syntactic sugar for :fooJan Krüger3-3/+53 2009-12-30Add completion for git-svn mkdirs,reset,and gcRobert Zeh1-2/+5 2009-12-30textconv: stop leaking file descriptorsJeff King1-0/+2 2009-12-30reset: unbreak hard resets with GIT_WORK_TREEJeff King2-4/+8 2009-12-29commit: --cleanup is a message optionGreg Price1-2/+4 2009-12-29git count-objects: handle packs bigger than 4GAndreas Schwab1-6/+6 2009-12-29t7102: make the test fail if one of its check failsNguyễn Thái Ngọc Duy1-7/+7 2009-12-29Remove http.authAnyJunio C Hamano2-23/+1 2009-12-29Documentation: always respect core.worktree if setNguyễn Thái Ngọc Duy1-8/+15 2009-12-27read_index(): fix reading extension size on BE 64-bit archsNathaniel W Filardo1-1/+1 2009-12-26Makefile: FreeBSD (both 7 and 8) needs OLD_ICONVJunio C Hamano1-0/+1 2009-12-26Start 1.6.6.X maintenance trackJunio C Hamano2-1/+16 2009-12-26Add git-http-backend to command-list.Tarmigan Casebolt1-0/+1 2009-12-26Kick off 1.7.0 cycleJunio C Hamano3-2/+66 2009-12-26t4019 "grep" portability fixJunio C Hamano1-28/+28 2009-12-26t1200: work around a bug in some implementations of "find"Junio C Hamano1-1/+1 2009-12-23Git 1.6.6v1.6.6Junio C Hamano3-4/+6