suricata
util-hugepages.c File Reference
#include "suricata.h"
#include "util-debug.h"
#include "util-hugepages.h"
#include "util-path.h"
Include dependency graph for util-hugepages.c:

Go to the source code of this file.

Typedefs

typedef enum OSHugepageAction_ OSHugepageAction
 

Enumerations

enum  OSHugepageAction_ { OS_UNKNOWN , OS_LINUX_SYS_DEVICES }
 

Functions

void SystemHugepageSnapshotDestroy (SystemHugepageSnapshot *s)
 
SystemHugepageSnapshotSystemHugepageSnapshotCreate (void)
 The function creates a snapshot of the system's hugepage usage per NUMA node and per hugepage size. The snapshot is used to evaluate the system's hugepage usage after initialization of Suricata.
 
void SystemHugepageEvaluateHugepages (SystemHugepageSnapshot *pre_s, SystemHugepageSnapshot *post_s)
 The function compares two hugepage snapshots and prints out recommendations for hugepage configuration.
 

Detailed Description

Author
Lukas Sismis lsism.nosp@m.is@o.nosp@m.isf.n.nosp@m.et

Definition in file util-hugepages.c.

Typedef Documentation

◆ OSHugepageAction

Enumeration Type Documentation

◆ OSHugepageAction_

Enumerator
OS_UNKNOWN 
OS_LINUX_SYS_DEVICES 

Definition at line 40 of file util-hugepages.c.

Function Documentation

◆ SystemHugepageEvaluateHugepages()

void SystemHugepageEvaluateHugepages ( SystemHugepageSnapshot pre_s,
SystemHugepageSnapshot post_s 
)

The function compares two hugepage snapshots and prints out recommendations for hugepage configuration.

Parameters
[in]pre_sa pointer to the snapshot taken before Suricata initialization
[in]post_sa pointer to the snapshot taken after Suricata initialization

Definition at line 363 of file util-hugepages.c.

References FatalError, HugepageInfo::free, NodeInfo::hugepages, SystemHugepageSnapshot::nodes, NodeInfo::num_hugepage_sizes, SystemHugepageSnapshot::num_nodes, SCLogDebug, SCLogPerf, SCLogWarning, and HugepageInfo::size_kb.

Referenced by SuricataPostInit().

Here is the caller graph for this function:

◆ SystemHugepageSnapshotCreate()

SystemHugepageSnapshot * SystemHugepageSnapshotCreate ( void  )

The function creates a snapshot of the system's hugepage usage per NUMA node and per hugepage size. The snapshot is used to evaluate the system's hugepage usage after initialization of Suricata.

Returns
a pointer to the snapshot, NULL on error

Definition at line 323 of file util-hugepages.c.

References FatalError, SystemHugepageSnapshot::nodes, SystemHugepageSnapshot::num_nodes, SCCalloc, SCFree, SCLogInfo, and SystemHugepageSnapshotDestroy().

Referenced by SuricataInit(), and SuricataPostInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SystemHugepageSnapshotDestroy()

void SystemHugepageSnapshotDestroy ( SystemHugepageSnapshot s)

Definition at line 304 of file util-hugepages.c.

References SystemHugepageSnapshot::nodes, SystemHugepageSnapshot::num_nodes, and SCFree.

Referenced by SuricataPostInit(), and SystemHugepageSnapshotCreate().

Here is the caller graph for this function: