Skip to content

Commit

Permalink
Merge pull request #41 from marioferh/delete_forCPUS_dead_code
Browse files Browse the repository at this point in the history
Delete dead code in irqs package
  • Loading branch information
ffromani authored Oct 21, 2021
2 parents a98759b + f068d43 commit 29c6862
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
13 changes: 0 additions & 13 deletions pkg/irqs/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ func (S Stats) Clone() Stats {
return R
}

func (S Stats) ForCPUs(cpus cpuset.CPUSet) Stats {
res := make(Stats)
cpuids := cpus.ToSlice()
for _, cpuid := range cpuids {
counter, ok := S[cpuid]
if !ok || len(counter) == 0 {
continue
}
res[cpuid] = counter
}
return res
}

type Info struct {
Source string
IRQ int
Expand Down
4 changes: 0 additions & 4 deletions pkg/irqs/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ type irqwatchDuration struct {
d time.Duration
}

func (d irqwatchDuration) MarshalJSON() (b []byte, err error) {
return []byte(fmt.Sprintf(`"%s"`, d.d.String())), nil
}

type irqSummary struct {
Elapsed irqwatchDuration `json:"elapsed"`
Counters Stats `json:"counters"`
Expand Down
11 changes: 0 additions & 11 deletions test/e2e/knit_irqwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
"github.com/openshift-kni/debug-tools/pkg/irqs"
"k8s.io/kubernetes/pkg/kubelet/cm/cpuset"
)

var _ = g.Describe("knit IRQ watch tests", func() {
Expand Down Expand Up @@ -198,16 +197,6 @@ func extractCountersFromIRQWatchOutput(b []byte) (irqs.Stats, error) {
return irqS.Counters, nil
}

func stats2JSON(s irqs.Stats) ([]byte, error) {
cpus := cpuset.CPUSet{}
cnt := struct {
Counters irqs.Stats
}{
Counters: s.ForCPUs(cpus),
}
return json.Marshal(cnt)
}

func areCountersEqual(c1, c2 irqs.Stats) bool {
return len(c1.Delta(c2)) == 0
}

0 comments on commit 29c6862

Please sign in to comment.