Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/tools/testing/selftests/bpf/progs/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  test_subskeleton_lib.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) Meta Platforms, Inc. and affiliates. */

#include <stdbool.h>
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>

/* volatile to force a read */
const volatile int var1;
volatile int var2 = 1;
struct {
 int var3_1;
 __s64 var3_2;
} var3;
int libout1;

extern volatile bool CONFIG_BPF_SYSCALL __kconfig;

int var4[4];

__weak int var5 SEC(".data");

/* Fully contained within library extern-and-definition */
extern int var6;

int var7 SEC(".data.custom");

int (*fn_ptr)(void);

struct {
 __uint(type, BPF_MAP_TYPE_HASH);
 __type(key, __u32);
 __type(value, __u32);
 __uint(max_entries, 16);
} map1 SEC(".maps");

extern struct {
 __uint(type, BPF_MAP_TYPE_HASH);
 __type(key, __u32);
 __type(value, __u32);
 __uint(max_entries, 16);
} map2 SEC(".maps");

int lib_routine(void)
{
 __u32 key = 1, value = 2;

 (void) CONFIG_BPF_SYSCALL;
 bpf_map_update_elem(&map2, &key, &value, BPF_ANY);

 libout1 = var1 + var2 + var3.var3_1 + var3.var3_2 + var5 + var6;
 return libout1;
}

SEC("perf_event")
int lib_perf_handler(struct pt_regs *ctx)
{
 return 0;
}

char LICENSE[] SEC("license") = "GPL";

Messung V0.5
C=92 H=98 G=94

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.