Skip to content

Conversation

@ttanatb
Copy link
Contributor

@ttanatb ttanatb commented Jun 25, 2022

Would like input/feedback on where this code should be called

Copy link
Member

@pmuetschard pmuetschard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the right place.

Comment on lines 426 to 448
lsResult, err := b.Shell(fmt.Sprintf("ls %s", counterFilePath)).Call(ctx)
if err != nil {
return err
}

// If the file does not exist
if lsResult != counterFilePath {
return nil
}

fileContent, err := b.Shell(fmt.Sprintf("cat %s", counterFilePath)).Call(ctx)
if err != nil {
return err
}

// Early exit if the file has already been edited.
if fileContent != "0" {
return nil
}

_, err = b.Shell(fmt.Sprintf("echo 1 > %s", counterFilePath)).Call(ctx)
return err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just do this to keep it short, it's a work-around after all:

b.Shell(fmt.Sprintf("[ -w %s ] && echo 1 > %s", counterFilePath, counterFilePath))

@ttanatb ttanatb changed the title [WIP] Enable Adreno GPU counters Enable Adreno GPU counters Jul 5, 2022
@ttanatb ttanatb merged commit 6e7810a into google:master Jul 6, 2022
rosasco-wk pushed a commit to rosasco-wk/agi that referenced this pull request Sep 3, 2022
Added extra adb shell commands to enable Adreno's GPU counters if needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants