Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 6 additions & 5 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"perfspect/internal/progress"
"perfspect/internal/report"
"perfspect/internal/script"
"perfspect/internal/table"
"perfspect/internal/target"
"perfspect/internal/util"
"slices"
Expand Down Expand Up @@ -283,7 +284,7 @@ func setOnTarget(cmd *cobra.Command, myTarget target.Target, flagGroups []flagGr

// getConfig collects the configuration data from the target(s)
func getConfig(myTargets []target.Target, localTempDir string) ([]common.TargetScriptOutputs, error) {
scriptNames := report.GetScriptNamesForTable(report.ConfigurationTableName)
scriptNames := table.GetScriptNamesForTable(table.ConfigurationTableName)
var scriptsToRun []script.ScriptDefinition
for _, scriptName := range scriptNames {
scriptsToRun = append(scriptsToRun, script.GetScriptByName(scriptName))
Expand Down Expand Up @@ -317,7 +318,7 @@ func getConfig(myTargets []target.Target, localTempDir string) ([]common.TargetS
for _, target := range myTargets {
for _, targetScriptOutputs := range allTargetScriptOutputs {
if targetScriptOutputs.TargetName == target.GetName() {
targetScriptOutputs.TableNames = []string{report.ConfigurationTableName}
targetScriptOutputs.TableNames = []string{table.ConfigurationTableName}
orderedTargetScriptOutputs = append(orderedTargetScriptOutputs, targetScriptOutputs)
break
}
Expand All @@ -333,9 +334,9 @@ func processConfig(targetScriptOutputs []common.TargetScriptOutputs) (map[string
var err error
for _, targetScriptOutput := range targetScriptOutputs {
// process the tables, i.e., get field values from raw script output
tableNames := []string{report.ConfigurationTableName}
var tableValues []report.TableValues
if tableValues, err = report.ProcessTables(tableNames, targetScriptOutput.ScriptOutputs); err != nil {
tableNames := []string{table.ConfigurationTableName}
var tableValues []table.TableValues
if tableValues, err = table.ProcessTables(tableNames, targetScriptOutput.ScriptOutputs); err != nil {
err = fmt.Errorf("failed to process collected data: %v", err)
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/config/flag_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package config
import (
"fmt"
"perfspect/internal/common"
"perfspect/internal/report"
"perfspect/internal/table"
"perfspect/internal/target"
"regexp"
"slices"
Expand Down Expand Up @@ -193,7 +193,7 @@ func initializeFlags(cmd *cobra.Command) {
flagGroups = append(flagGroups, group)
// prefetcher options
group = flagGroup{name: flagGroupPrefetcherName, flags: []flagDefinition{}}
for _, pref := range report.GetPrefetcherDefinitions() {
for _, pref := range table.GetPrefetcherDefinitions() {
group.flags = append(group.flags,
newStringFlag(cmd,
// flag name
Expand Down
12 changes: 6 additions & 6 deletions cmd/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log/slog"
"math"
"perfspect/internal/cpus"
"perfspect/internal/report"
"perfspect/internal/script"
"perfspect/internal/table"
"perfspect/internal/target"
"perfspect/internal/util"
"regexp"
Expand Down Expand Up @@ -131,19 +131,19 @@ func setLlcSize(desiredLlcSize float64, myTarget target.Target, localTempDir str
return fmt.Errorf("failed to run scripts on target: %w", err)
}

uarch := report.UarchFromOutput(outputs)
uarch := table.UarchFromOutput(outputs)
cpu, err := cpus.GetCPUByMicroArchitecture(uarch)
if err != nil {
return fmt.Errorf("failed to get CPU by microarchitecture: %w", err)
}
if cpu.CacheWayCount == 0 {
return fmt.Errorf("cache way count is zero")
}
maximumLlcSize, _, err := report.GetL3LscpuMB(outputs)
maximumLlcSize, _, err := table.GetL3LscpuMB(outputs)
if err != nil {
return fmt.Errorf("failed to get maximum LLC size: %w", err)
}
currentLlcSize, _, err := report.GetL3MSRMB(outputs)
currentLlcSize, _, err := table.GetL3MSRMB(outputs)
if err != nil {
return fmt.Errorf("failed to get current LLC size: %w", err)
}
Expand Down Expand Up @@ -823,15 +823,15 @@ func getUarch(myTarget target.Target, localTempDir string) (string, error) {
if err != nil {
return "", fmt.Errorf("failed to run scripts on target: %w", err)
}
uarch := report.UarchFromOutput(outputs)
uarch := table.UarchFromOutput(outputs)
if uarch == "" {
return "", fmt.Errorf("failed to get microarchitecture")
}
return uarch, nil
}

func setPrefetcher(enableDisable string, myTarget target.Target, localTempDir string, prefetcherType string) error {
pf, err := report.GetPrefetcherDefByName(prefetcherType)
pf, err := table.GetPrefetcherDefByName(prefetcherType)
if err != nil {
return fmt.Errorf("failed to get prefetcher definition: %w", err)
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/flame/flame.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"perfspect/internal/common"
"perfspect/internal/report"
"perfspect/internal/table"
"perfspect/internal/util"
"slices"
"strconv"
Expand Down Expand Up @@ -177,9 +178,9 @@ func validateFlags(cmd *cobra.Command, args []string) error {
func runCmd(cmd *cobra.Command, args []string) error {
var tableNames []string
if !flagNoSystemSummary {
tableNames = append(tableNames, report.BriefSysSummaryTableName)
tableNames = append(tableNames, table.BriefSysSummaryTableName)
}
tableNames = append(tableNames, report.CallStackFrequencyTableName)
tableNames = append(tableNames, table.CallStackFrequencyTableName)
reportingCommand := common.ReportingCommand{
Cmd: cmd,
ReportNamePost: "flame",
Expand Down
7 changes: 4 additions & 3 deletions cmd/lock/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"perfspect/internal/progress"
"perfspect/internal/report"
"perfspect/internal/script"
"perfspect/internal/table"
"perfspect/internal/target"
"slices"
"strconv"
Expand Down Expand Up @@ -165,7 +166,7 @@ func formalizeOutputFormat(outputFormat []string) []string {

func pullDataFiles(appContext common.AppContext, scriptOutputs map[string]script.ScriptOutput, myTarget target.Target, statusUpdate progress.MultiSpinnerUpdateFunc) error {
localOutputDir := appContext.OutputDir
tableValues := report.GetValuesForTable(report.KernelLockAnalysisTableName, scriptOutputs)
tableValues := table.GetValuesForTable(table.KernelLockAnalysisTableName, scriptOutputs)
found := false
for _, field := range tableValues.Fields {
if field.Name == "Perf Package Path" {
Expand Down Expand Up @@ -194,9 +195,9 @@ func pullDataFiles(appContext common.AppContext, scriptOutputs map[string]script
func runCmd(cmd *cobra.Command, args []string) error {
var tableNames []string
if !flagNoSystemSummary {
tableNames = append(tableNames, report.BriefSysSummaryTableName)
tableNames = append(tableNames, table.BriefSysSummaryTableName)
}
tableNames = append(tableNames, report.KernelLockAnalysisTableName)
tableNames = append(tableNames, table.KernelLockAnalysisTableName)
reportingCommand := common.ReportingCommand{
Cmd: cmd,
ReportNamePost: "lock",
Expand Down
8 changes: 4 additions & 4 deletions cmd/metrics/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"perfspect/internal/cpus"
"perfspect/internal/progress"
"perfspect/internal/report"
"perfspect/internal/script"
"perfspect/internal/table"
"perfspect/internal/target"
)

Expand Down Expand Up @@ -526,7 +526,7 @@ func getMetadataScripts(noRoot bool, noSystemSummary bool, numGPCounters int) (m
}
// add the system summary table scripts to the list
if !noSystemSummary {
table := report.GetTableByName(report.BriefSysSummaryTableName)
table := table.GetTableByName(table.BriefSysSummaryTableName)
for _, scriptName := range table.ScriptNames {
scriptDef := script.GetScriptByName(scriptName)
metadataScripts = append(metadataScripts, scriptDef)
Expand Down Expand Up @@ -609,8 +609,8 @@ func ReadJSONFromFile(path string) (md Metadata, err error) {

// getSystemSummary - retrieves the system summary from the target
func getSystemSummary(scriptOutputs map[string]script.ScriptOutput) (summaryFields [][]string, err error) {
var allTableValues []report.TableValues
allTableValues, err = report.ProcessTables([]string{report.BriefSysSummaryTableName}, scriptOutputs)
var allTableValues []table.TableValues
allTableValues, err = table.ProcessTables([]string{table.BriefSysSummaryTableName}, scriptOutputs)
if err != nil {
err = fmt.Errorf("failed to process script outputs: %w", err)
return
Expand Down
Loading