MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_hugepage_path

Function get_hugepage_path

dpdk/app/test/test_eal_flags.c:138–153  ·  view source on GitHub ↗

if string contains a hugepage path */

Source from the content-addressed store, hash-verified

136
137/* if string contains a hugepage path */
138static int
139get_hugepage_path(char * src, int src_len, char * dst, int dst_len)
140{
141#define NUM_TOKENS 4
142 char *tokens[NUM_TOKENS];
143
144 /* if we couldn't properly split the string */
145 if (rte_strsplit(src, src_len, tokens, NUM_TOKENS, ' ') < NUM_TOKENS)
146 return 0;
147
148 if (strncmp(tokens[2], "hugetlbfs", sizeof("hugetlbfs")) == 0) {
149 strlcpy(dst, tokens[1], dst_len);
150 return 1;
151 }
152 return 0;
153}
154
155/*
156 * Cycles through hugepage directories and looks for hugepage

Callers 2

process_hugefilesFunction · 0.85
test_misc_flagsFunction · 0.85

Calls 3

rte_strsplitFunction · 0.85
strncmpFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected