Updated Branches: refs/heads/master 019a9adc3 -> 0896acc5f
TS-1356 needed for getting the topology information for hwloc Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0896acc5 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0896acc5 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0896acc5 Branch: refs/heads/master Commit: 0896acc5fde259f043a3ccad5fc972538c26469f Parents: 019a9ad Author: Bryan Call <[email protected]> Authored: Wed Aug 22 12:05:05 2012 -0700 Committer: Bryan Call <[email protected]> Committed: Wed Aug 22 12:05:05 2012 -0700 ---------------------------------------------------------------------- lib/ts/ink_defs.cc | 7 +++++++ lib/ts/ink_defs.h | 7 +++++++ 2 files changed, 14 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0896acc5/lib/ts/ink_defs.cc ---------------------------------------------------------------------- diff --git a/lib/ts/ink_defs.cc b/lib/ts/ink_defs.cc index d5832a0..4fa5fe1 100644 --- a/lib/ts/ink_defs.cc +++ b/lib/ts/ink_defs.cc @@ -48,6 +48,13 @@ int on = 1; static hwloc_topology_t gTopology; static bool hwloc_setup = false; +// Get the topology +const hwloc_topology_t* +ink_get_topology() +{ + return &gTopology; +} + // Little helper to initialize the hwloc topology, once. void static inline setup_hwloc() http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0896acc5/lib/ts/ink_defs.h ---------------------------------------------------------------------- diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h index 4f1d0b2..806c226 100644 --- a/lib/ts/ink_defs.h +++ b/lib/ts/ink_defs.h @@ -32,6 +32,9 @@ #ifndef ABS #define ABS(_x_) (((_x_) < 0) ? ( - (_x_)) : (_x_)) #endif +#if TS_USE_HWLOC +#include <hwloc.h> +#endif /* Debugging */ @@ -87,6 +90,10 @@ extern int on; */ int ink_sys_name_release(char *name, int namelen, char *release, int releaselen); int ink_number_of_processors(); +#if TS_USE_HWLOC +// Get the hardware topology +const hwloc_topology_t* ink_get_topology(); +#endif /** Constants. */
