mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 14:53:11 +01:00
Adding mem2node object to allow the easy lookup of the node for the physical address. It has following interface: int mem2node__init(struct mem2node *map, struct perf_env *env); void mem2node__exit(struct mem2node *map); int mem2node__node(struct mem2node *map, u64 addr); The mem2node__toolsinit initialize object from the perf data file MEM_TOPOLOGY feature data. Following calls to mem2node__node will return node number for given physical address. The mem2node__exit function frees the object. Signed-off-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: David Ahern <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
20 lines
383 B
C
20 lines
383 B
C
#ifndef __MEM2NODE_H
|
|
#define __MEM2NODE_H
|
|
|
|
#include <linux/rbtree.h>
|
|
#include "env.h"
|
|
|
|
struct phys_entry;
|
|
|
|
struct mem2node {
|
|
struct rb_root root;
|
|
struct phys_entry *entries;
|
|
int cnt;
|
|
};
|
|
|
|
int mem2node__init(struct mem2node *map, struct perf_env *env);
|
|
void mem2node__exit(struct mem2node *map);
|
|
int mem2node__node(struct mem2node *map, u64 addr);
|
|
|
|
#endif /* __MEM2NODE_H */
|