Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,20 @@ acpi_get_sig(const char *sig)
return tbl;
}

/*
* When the kernel exposes ACPI tables under /sys/firmware/acpi/tables
* it exposes all of them there (every table listed in the RSDT/XSDT,
* whether or not the kernel supports it). So if that directory exists
* but this table is not in it, the table is not present on the
* platform and scanning memory for it would be pointless.
*/
if (pqos_dir_exists(ACPI_TABLE_FS_PATH)) {
LOG_DEBUG("ACPI table %s not present in sysfs; "
"skipping memory scan\n",
sig);
return NULL;
}

LOG_DEBUG("Trying to obtain %s acpi table from ACPI memory\n", sig);
return acpi_get_mmap(sig);
}
Expand Down
19 changes: 18 additions & 1 deletion lib/cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,25 @@ cpuinfo_build_topo(struct apic_info *apic)

for (i = 0; i < max_core_count; ++i)
if (detect_cpu(i, apic, &l_cpu->cores[core_count],
max_core_count) == 0)
max_core_count) == 0) {
#ifdef __linux__
/*
* The APIC-derived topology does not give the
* physical core id, so read it from sysfs (same
* source as the OS interface). SMT siblings share
* (socket, core_id). Left at 0 if unavailable.
*/
char core_path[256];

snprintf(core_path, sizeof(core_path) - 1,
"/sys/devices/system/cpu/cpu%u/topology/"
"core_id",
l_cpu->cores[core_count].lcore);
pqos_fread_uint(core_path,
&l_cpu->cores[core_count].core_id);
#endif
core_count++;
}

if (set_affinity_mask(current_mask, max_core_count) != 0) {
LOG_ERROR("Couldn't restore original CPU affinity mask!");
Expand Down
43 changes: 43 additions & 0 deletions lib/go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool
*.out

# Dependency directories
vendor/

# Go workspace file
go.work

# Build artifacts
examples/*/capability
examples/*/simple
examples/capability/capability
examples/simple/simple

# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Temporary files
*.tmp
*.bak

# Go build cache
.cache/

# Coverage reports
coverage.txt
coverage.html
Loading