| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
This commit replaces all `ioutil.TempDir` with `t.TempDir` in tests.
The directory created by `t.TempDir` is automatically removed when the
test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
It creates a temp dir in cwd, which is not guaranteed to be writable.
Create temp dir in temp instead.
Also don't assume Linux path separator, won't work on Windows.
Also actually check the result, current test would be happy
if glob always returns empty match as well.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PCs returned for dynamic loaded module (DLKM) is not
parsed in coverage page, these PCs are dropped.
The commit is to use DLKM modules' load address and symbol file
to restore the PC and show coverage data of DLKM.
Introduced new config module_obj to specify module directories.
Example of config:
"module_obj": [
"module_path1"
"module_path2"
]
For linux target, before Manager.Connect run, load addresses are
getting from /proc/modules in order to group PCs into modules.
And so, if modules are under kernel_obj or module_obj dir,
their addresses and paths can be generated automatically.
kernel_obj is searched before module_obj dir and the first found
ko object is always used.
Also note that kaslr needs to be disabled.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We use strings to identify OS/Arch.
These strings are duplicated throughout the code base massively.
golangci-lint points to possiblity of typos and duplication.
We already had to define these names in pkg/csource
and disable checking for prog package. A future change triggers
such warnings in another package.
Add OS/Arch name consts to sys/targets so that they can be used
to refer to OS/Arch. Use the consts everywhere.
|
| |
|
|
| |
This should prevent the test from breaking on different arches in future.
|
| |
|
|
|
|
|
| |
Refactor tests so that they can be used with canned info.
The test fails for lots of different archs and we don't have any tests,
so these will keep breaking.
This change prepared for tests with canned info.
|
| |
|
|
|
|
|
|
|
|
| |
Not all architectures have fields in /proc/cpuinfo for vendor, model and
flags, e.g. powerpc doesn't have an equivalent for vendor or flags.
Rather than testing for the presence of at least one field name for each
category, have a separate list per architecture.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There is no field 'machine' in /proc/cpuinfo when we run inside
a Docker container but there is a 'processor 0' field which
provides the same information.
Example:
processor 0: version = 00, identification = 310C57, machine = 3906
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
|
| |
|
|
|
|
|
| |
Use the field 'machine' in /proc/cpuinfo on IBM/Z
to find out the "CPU model".
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
|
|
|
TestScanCPUInfo does not build on !linux.
TestMachineInfoLinux builds, but does not do anything useful.
|