mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 23:47:06 +00:00
This patch modifies util/string.[ch] to add new function: perf_atoll() to parse string representing size in bytes. This function parses (\d+)(b|B|kb|KB|mb|MB|gb|GB) (e.g. "256MB") and returns its numeric value. (e.g. 268435456) Signed-off-by: Hitoshi Mitake <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
14 lines
264 B
C
14 lines
264 B
C
#ifndef __PERF_STRING_H_
|
|
#define __PERF_STRING_H_
|
|
|
|
#include "types.h"
|
|
|
|
int hex2u64(const char *ptr, u64 *val);
|
|
char *strxfrchar(char *s, char from, char to);
|
|
s64 perf_atoll(const char *str);
|
|
|
|
#define _STR(x) #x
|
|
#define STR(x) _STR(x)
|
|
|
|
#endif /* __PERF_STRING_H */
|