Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDP User Plugin Format changes #7555

Closed
wants to merge 10 commits into from

Conversation

nishraptor
Copy link
Collaborator

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

Format changes for User Plugin

@gbuildx
Copy link
Collaborator

gbuildx commented May 17, 2023

Build Passed!

Signed-off-by: Nishant Mysore <nishraptor@gmail.com>
Signed-off-by: Nishant Mysore <nishraptor@gmail.com>
extern "C"
XDP_EXPORT
void user_event_end_cb(unsigned int functionID) ;
extern "C" XDP_EXPORT void user_event_end_cb(unsigned int functionID);
Copy link
Member

Choose a reason for hiding this comment

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

Think It's preferable and to put exports and externs on separate lines.

Copy link
Collaborator

@IshitaGhosh IshitaGhosh May 17, 2023

Choose a reason for hiding this comment

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

Yes, XRT code also uses separate lines.

VTFEvent* event = new UserRange(
start, static_cast<double>(timestamp),
false, // isStart
0, 0);
Copy link
Member

Choose a reason for hiding this comment

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

This makes sense. However some minor issues:

  1. We use 2 spaces for indentation. 4 isn't consistent with that.
  2. Also, I'd propose the end bracket to be on new line for even more clarity.
    VTFEvent* event = new UserRange (
    start, static_cast(timestamp),
    false, // isStart
    0, 0
    );

db->getStaticInfo().addOpenedFile(w->getcurrentFileName(), "VP_TRACE");
}
db->unregisterPlugin(this) ;
db->unregisterPlugin(this);
}
UserEventsPlugin::live = false;
}

void UserEventsPlugin::writeAll(bool openNewFiles)
Copy link
Member

Choose a reason for hiding this comment

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

XRT code also puts class types on a separate line like:
void UserEventsPlugin::
writeAll(bool openNewFiles)

I'd propose we follow that.


const char* labelStr = (label == nullptr) ? "" : label ;
const char* tooltipStr = (tooltip == nullptr) ? "" : tooltip ;
Copy link
Member

Choose a reason for hiding this comment

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

I think it's okay to add extra spaces for sake of readability

@gbuildx
Copy link
Collaborator

gbuildx commented May 17, 2023

Build Passed!

@nishraptor nishraptor closed this Jun 2, 2023
@nishraptor nishraptor deleted the userpluginreformat branch June 21, 2023 20:40
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.

5 participants