commit | cef82c9f5a3deab94c1f1f02cfc25213844852ed | [log] [tgz] |
---|---|---|
author | Jiri Olsa <[email protected]> | Tue Dec 03 14:09:22 2013 +0100 |
committer | Arnaldo Carvalho de Melo <[email protected]> | Wed Dec 04 15:20:12 2013 -0300 |
tree | 72bd6003cdb4692b964a5a5b05feb877a5c116bc | |
parent | 3d7c0144491bd8c21d53b43032274a85efdfe434 [diff] |
perf tools: Add filename__read_str util function Adding filename__read_str util function to read text file and return it in the char array. The interface is: int filename__read_str(const char *filename, char **buf, size_t *sizep) Returns 0/-1 if the read suceeded/fail respectively. buf - place to store the data pointer size - place to store data size v2 change: - better error handling suggested by Namhyung Kim. Signed-off-by: Jiri Olsa <[email protected]> Cc: Corey Ashford <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>