Skip to content

Conversation

@ywkaras
Copy link
Contributor

@ywkaras ywkaras commented Apr 27, 2022

No description provided.

@ywkaras ywkaras requested a review from zwoop as a code owner April 27, 2022 20:25
@ywkaras ywkaras self-assigned this Apr 27, 2022
@ywkaras ywkaras added Performance Debug Support for system debugging labels Apr 27, 2022
@ywkaras ywkaras added this to the 10.0.0 milestone Apr 27, 2022
}

#define SMDebug(tag, fmt, ...) SpecificDebug(debug_on, tag, "[%" PRId64 "] " fmt, sm_id, ##__VA_ARGS__)
#if defined(Dbg) // Optimized debug available.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use of conditional compilation here means that we could backport this PR to a 9.x release without having to also backport #8581 . Could be useful if we need to backport later PRs that also change HttpSM.cc extensively.


#else

#define DebugHttpRange(fmt, ...) Debug("htto_range", fmt, ##__VA_ARGS__)
Copy link
Member

Choose a reason for hiding this comment

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

typo: htto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

{ \
/*ink_assert (magic == HTTP_SM_MAGIC_ALIVE); */ REMEMBER(event, reentrancy_count); \
SMDebug("http", "[%s, %s]", #state_name, HttpDebugNames::get_event_name(event)); \
SMDebugHttp("[%s, %s]", #state_name, HttpDebugNames::get_event_name(event)); \
Copy link
Member

Choose a reason for hiding this comment

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

It's sad that I can't see the actual tag name, although that might have already been discussed when the new interface was proposed. This one is ok, but "ip-allow" is tricky because it uses "-" where most other tags use "_".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SolidWallOfCode did you pick the tag name "ip-allow"? Do you care if I change it to "ip_allow"?

I could also change to a naming pattern where, for example, SMDebug_http_trans (rather than SMDebugHttpTrans) corresponds to the tag "http_trans".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If all debug tags were valid C++ identifiers, then I wouldn't need the SMDebugXxx() macros. This:

SMDebug("http_trans", "Unable to accelerate range request, fallback to transform");

would instead become this:

SMDebug(http_trans, "Unable to accelerate range request, fallback to transform");

The implementation would use either the concatenation or stringization macro operators:

#if defined(Dbg)

namespace
{
DbgCtl dbgCtl_http_trans;
// ...
}

#define SMDebug(tag, fmt, ...) SpecificDbg(debug_on, dbgCtl_ # tag, "[%" PRId64 "] " fmt, sm_id, ##__VA_ARGS__)

#else

#define SMDebug(tag, fmt, ...) SpecificDbg(debug_on, #tag, "[%" PRId64 "] " fmt, sm_id, ##__VA_ARGS__)

#endif

Copy link
Member

Choose a reason for hiding this comment

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

If all debug tags were valid C++ identifiers...

I like the concatenation/stringization macro idea. It would be confusing a little since old Debug() requires quotations though, I prefer it rather than other naming patterns.

Also, somebody told me that he prefer to have "Debug" at the end of macro names because that enables you to find (grep) Debug lines easily, when I added macros for HTTP/2 or 3.

@ywkaras
Copy link
Contributor Author

ywkaras commented Apr 28, 2022

[approve ci ubuntu]

@ywkaras ywkaras marked this pull request as draft May 2, 2022 23:26
@ywkaras ywkaras marked this pull request as ready for review May 6, 2022 00:06
@ywkaras
Copy link
Contributor Author

ywkaras commented May 6, 2022

I marked this for backport to 9.2, since it seems likely there will be later changes to HttpSM.cc that will have to be backported to 9.2.

@maskit
Copy link
Member

maskit commented May 6, 2022

If we change "ip-allow" to "ip_allow", we should change ones in IPAllow.cc, HttpTransact.cc, and ip_allow.test.py as well.

I marked this for backport to 9.2, since it seems likely there will be later changes to HttpSM.cc that will have to be backported to 9.2.

I understand that would make backporting other changes easy but isn't the change for "ip-allow" technically an incompatible change? I personally don't mind changing debug tag names on a minor release though.

In either case, we should probably make the change for "ip-allow" separately on another PR for change logs and release notes. We can discuss about the incompatibility on the PR, and that would tell whether we can backport this to 9.x.

@ywkaras ywkaras marked this pull request as draft May 6, 2022 15:19
@ywkaras
Copy link
Contributor Author

ywkaras commented May 6, 2022

#8830 should be merged prior to merging this PR.

@ywkaras
Copy link
Contributor Author

ywkaras commented May 11, 2022

The Au test run finished successfully, even though it is reported as "pending": https://ci.trafficserver.apache.org/job/Github_Builds/job/autest/968/consoleFull
(See the line 'Commit message: "Merge commit '654417e6ab6fce629d50976c71dac90a32a4b348' into HEAD"').

@ywkaras ywkaras marked this pull request as ready for review May 11, 2022 17:06
@bneradt
Copy link
Contributor

bneradt commented May 11, 2022

The Au test run finished successfully, even though it is reported as "pending": https://ci.trafficserver.apache.org/job/Github_Builds/job/autest/968/consoleFull
(See the line 'Commit message: "Merge commit '654417e6ab6fce629d50976c71dac90a32a4b348' into HEAD"').

Oh, interesting. I haven't seen that before. Seems like the jenkins message about the passed autest didn't make it back to github. I'll kick off autest again.

@apache apache deleted a comment from bneradt May 11, 2022
@maskit
Copy link
Member

maskit commented May 13, 2022

I think we should land this on 10-Dev branch if I understand why the branch exists correctly.

@ywkaras
Copy link
Contributor Author

ywkaras commented May 13, 2022

I thought that 10-Dev was for certain select large features.

@maskit
Copy link
Member

maskit commented May 17, 2022

It isn't limited to large features. Incompatible changes should not be merged on master.

I thought we agreed that the ip_allow change is incompatible because you unmarked 9.2.

@ywkaras
Copy link
Contributor Author

ywkaras commented May 17, 2022

There would probably be many merge conflicts in HttpSM.cc every time we merged master to 10-Dev.

In any case, more urgent work has come up, so I must put this aside for now.

@ywkaras ywkaras marked this pull request as draft May 17, 2022 17:02
@ywkaras
Copy link
Contributor Author

ywkaras commented May 24, 2022

The practical way to do this is to merge it on master right after release 9.2 comes out (and make sure it's the first commit in any hypothetical 9.3).

@maskit
Copy link
Member

maskit commented May 24, 2022

Strictly speaking, this change itself is not incompatible, but #8830 is, IMO. The problem (I think) is that #8830 is already on master. #8830 should be reverted on master and the change should be made on 10-Dev first, if we agree on the change is incompatible.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.

@github-actions github-actions bot added the Stale label Aug 23, 2022
@ywkaras ywkaras closed this Aug 23, 2022
@zwoop zwoop removed this from the 10.0.0 milestone Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Debug Support for system debugging Performance Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants