Skip to content

Commit

Permalink
Skip frequent multipath and iscsiadm utils used only for logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mravi-na authored Feb 8, 2024
1 parent f3e6444 commit a2930d4
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions utils/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"time"

"github.com/cenkalti/backoff/v4"
log "github.com/sirupsen/logrus"
"golang.org/x/net/context"

. "github.com/netapp/trident/logging"
Expand Down Expand Up @@ -321,11 +320,6 @@ func GetDeviceNameFromMount(ctx context.Context, mountpath string) (string, int,

// In the case of a iscsi trace debug, log info about session and what devices are present
func listAllISCSIDevices(ctx context.Context) {
if !IsLevelEnabled(log.TraceLevel) {
// Don't even run the commands if trace logging is not enabled
return
}

Logc(ctx).Trace(">>>> devices.listAllISCSIDevices")
defer Logc(ctx).Trace("<<<< devices.listAllISCSIDevices")
// Log information about all the devices
Expand All @@ -346,14 +340,16 @@ func listAllISCSIDevices(ctx context.Context) {
for _, entry := range entries {
sysLog = append(sysLog, entry.Name())
}
out1, _ := command.ExecuteWithTimeout(ctx, "multipath", deviceOperationsTimeout, true, "-ll")
out2, _ := execIscsiadmCommand(ctx, "-m", "session")

// TODO: Call this only when verbose logging requires beyond debug level.
// out1, _ := command.ExecuteWithTimeout(ctx, "multipath", deviceOperationsTimeout, true, "-ll")
// out2, _ := execIscsiadmCommand(ctx, "-m", "session")
Logc(ctx).WithFields(LogFields{
"/dev/dm-*": dmLog,
"/dev/sd*": sdLog,
"/sys/block/*": sysLog,
"multipath -ll output": string(out1),
"iscsiadm -m session output": string(out2),
"/dev/dm-*": dmLog,
"/dev/sd*": sdLog,
"/sys/block/*": sysLog,
// "multipath -ll output": string(out1),
// "iscsiadm -m session output": string(out2),
}).Trace("Listing all iSCSI Devices.")
}

Expand Down

0 comments on commit a2930d4

Please sign in to comment.