Brice Goglin [Tue, 27 Aug 2013 15:38:09 +0000 (15:38 +0000)]
lstopo: add a lstopoStyle info attribute to cha...
lstopo: add a lstopoStyle info attribute to change colors
This attribute must be a semi-colon-separated list of "<attr>=#xxyyzz".
<attr> can be Background (to change the box color), Background2
(other box color), Text (main text color) or Text2 (other text color).
Numbers are hexidecimal, truncated to [0-255].
Details in CUSTOM COLORS in the lstopo(1) manpage.
Initialize everything to 0xff (unknown) before reading the config space,
remove useless size checks everything, and rely on the callee to actually
check things it reads (it already did).
libpci doesn't report the length of the config space it actually reads,
so we can't safely rely on config space size checks. So this actually stop
using unitialized config space data when not running as root
(between 65th and 256th bytes, where we look for capabilities and link speed).
Samuel Thibault [Thu, 18 Jul 2013 10:18:22 +0000 (10:18 +0000)]
See http://sourceware.org/bugzilla/show_bug.cgi...
See http://sourceware.org/bugzilla/show_bug.cgi?id=15630 for the bug report, and http://sourceware.org/ml/libc-alpha/2013-07/msg00288.html for the discussion: glibc's sched_getaffinity may stop returning EINVAL as an indication of a too small cpu_set_t, because applications using static cpu_set_t do not have a way to overcome. It happens that since at least 2.6.32, linux provides exactly what we want in /sys/devices/system/cpu/possible, so let's use that too.
Misc can be added though insert_by_parent (load from XML) or explicit
insert_misc_by_parent/cpuset(). So move the actual setting of their
depth or these, instead of trying to do it during level build
since Misc objects are kind of ignored there anyway.
This fixes tests/hwloc_insert_misc when debug is enabled
(depth was 0 instead of -1 when reloading from XML).
Recent Xeon Phi drivers properly setup sysfs symlinks between mics
and pci devices. The usual lookup is therefore now the expected code.
Make sure the directlookup hack for older drivers doesn't run in
that normal case: have the first try detect things so that we never
try it again.
This will also reduce the number of useless lookups on non-MIC machines.
Brice Goglin [Mon, 24 Jun 2013 09:59:38 +0000 (09:59 +0000)]
core: fix support for Misc objects added by par...
core: fix support for Misc objects added by parent
Looks like nobody ever tried to load a XML that contains a Misc
added by parent, it has been broken for ever.
When added by cpuset, Misc get a cpuset as any object. Nothing to do.
When added by parent, they become a new leaf, so they need either empty
or NULL sets. Empty sets require lots of hacks to be properly handled by
the core (so that they don't get ignored). So we keep using NULL sets
instead and just fix a couple places to properly handle them (like I/O).
By the way, cleanup the addition of default object sets.
Brice Goglin [Thu, 20 Jun 2013 09:09:03 +0000 (09:09 +0000)]
configure: change "basic" into "linux" in the P...
configure: change "basic" into "linux" in the PCI component name
linuxpci is close to become the default, we can't call it "basic" anymore.
For the record, it misses device/vendor names, bridges,
but it supports fsroot changing.
Brice Goglin [Thu, 20 Jun 2013 09:08:43 +0000 (09:08 +0000)]
Remove the PCI component type, use MISC again
This somehow reverts r5542 which added this type.
We don't need a conflict between PCI backends anymore,
so no need for a specific type.
We don't revert the plugin ABI change because we have added
some core features for backends in the meantime, and we don't
want old PCI backends to be loaded since they wouldn't properly
detect other PCI backends.
Brice Goglin [Thu, 20 Jun 2013 09:08:15 +0000 (09:08 +0000)]
Remove the need to conflicts between PCI backen...
Remove the need to conflicts between PCI backends
Force a level reconnect before running their discover callback,
and check whether there are already some PCI devices.
On !Linux, the reconnect won't happen by default because
another one is done earlier nothing was added in the middle
(PCI comes right after CPU/GLOBAL by default).
On Linux, we have an additional reconnect (can't be merged
with the final one because we remove ignored things in the middle).
By the way, add some debug messages about these forced reconnects.
Brice Goglin [Fri, 14 Jun 2013 14:47:50 +0000 (14:47 +0000)]
tests/linux/gather: disable I/O for now
Enabling I/O will require to
* make sure we're gathering all required directories
(some virtual machine would need /sys/devices/virtio-pci for instance)
* force linuxpci to be used
* pass --io to gather and remove --no-io from lstopo
Brice Goglin [Fri, 14 Jun 2013 14:32:25 +0000 (14:32 +0000)]
linuxpci: don't set the bridge os_index
The discovery order depends on the /sys/bus/pci/devices/ directory order,
which sometimes breaks linux/tests/ depending on the whether.
We can't put anything really useful here (these bridges are only guessed
by looking at PCI devices). And we already have the logical order anyway,
so don't bother initializing os_index at all.
Brice Goglin [Fri, 14 Jun 2013 14:14:55 +0000 (14:14 +0000)]
tests/linux: Add the very first test case with ...
tests/linux: Add the very first test case with PCI fsroot, and check I/O groups
The tarball contains additional I/O files.
We force the use of the linuxpci plugin since only this one supports fsroot.
We also force the locality of the I/O buses because this 4-socket machine
(Dell PE R910 with 4 westmere EX processors) has I/O hubs connected to pairs
of socket, and the BIOS does not report it correctly.
This also checks that the PCI code properly place hostbridges under a group
of two sockets (and that these groups are correct sets, fixed in r5665).
Brice Goglin [Fri, 14 Jun 2013 14:13:22 +0000 (14:13 +0000)]
linux: remove two debug asserts that make no se...
linux: remove two debug asserts that make no sense
We actually wanted to check topology->backends (the first one) instead
of the local backend variable (which is obviously "linux").
But this code can still be valid when using x86+linux anyway.
Brice Goglin [Fri, 14 Jun 2013 12:01:40 +0000 (12:01 +0000)]
linux: Remove invalid block OS devices on old k...
linux: Remove invalid block OS devices on old kernels
2.6.9/RHEL4 (on eddie) have a "block" symlink in their device
subdirectory of PCI sysfs devices (and nothing for other classes).
We only handle block/<name> (modern kernels) and block:<name>
(old but not so ancient kernels).
Our code confuses this 2.6.9 case with the modern one, causing
crazy OS device such as "queue" to appear.
Fix that case by just not creating anything in these PCI devices
since there's no easy way to find the OS device name,
and we don't care much about these kernels anyway.
Brice Goglin [Thu, 13 Jun 2013 13:58:06 +0000 (13:58 +0000)]
Fix missing cpusets/nodesets in groups added by...
Fix missing cpusets/nodesets in groups added by PCI backends.
PCI components discover things after some object setup is done,
so if they add new groups, those may miss some attributes.
total_memory was fixed in the previous commit.
This commit updates cpusets/nodesets as well.
Only the main cpuset field was setup for real before this.
Brice Goglin [Thu, 13 Jun 2013 09:32:46 +0000 (09:32 +0000)]
Add a dlsym sanity check during dynamic plugin ...
Add a dlsym sanity check during dynamic plugin loading
Will prevent spurious crashes when hwloc is dynamically
loaded by another plugin mechanism.
This check doesn't seem needed when hwloc gets loaded
by a ltdl-plugin, the loading just fails immediately
because of the missing symbol.
But some OpenCL lib load plugins with dlopen(RTLD_LAZY),
causing a crash later during the instantiate callback.
That's where we add this sanity check to avoid the crash.
The component remains loaded but it doesn't get enabled
in the topology.
Brice Goglin [Wed, 29 May 2013 09:52:47 +0000 (09:52 +0000)]
Never merge explicitly-custom-inserted groups
If the user inserts one, don't remove it.
This relies on string info attributes (added in previous commits),
and we try to not look at these and strcmp() their value unless
all lights are green.
Brice Goglin [Sat, 25 May 2013 12:58:36 +0000 (12:58 +0000)]
tests/rename: make things more portable so that...
tests/rename: make things more portable so that we can regression-test it
* Don't use advanced sed features.
* Add NDEBUG so that some versions of assert don't stringify things
that wouldn't be renamed and would be hard to filter out.
* Handle the case where a##b is processed by gcc instead of cpp
(occurs at least on OpenBSD 5.2 with cpp/gcc 4.2.1).
Brice Goglin [Fri, 24 May 2013 20:21:50 +0000 (20:21 +0000)]
rename: Fix the renaming of hwloc_fls/ffs*
hwloc_flsl/ffsl may be macros or static inlines depending on the platform.
We can't easily rename this because renaming occurs before the definition,
we don't know yet if it will be a macro or not, and we don't rename macros
(or we would redefine the #define).
Add an intermediate name in the case of static inline
(hwloc_ffsl_from_ffs32, hwloc_flsl_manual, etc.).
Rename those always-static-inline name.
And #define the final hwloc_flsl/ffsl to those, so that
hwloc_ffsl/flsl are always #define, and don't need renaming.
This prevents hwloc_ffsl/flsl symbols to miss the renaming on some
platforms.