RFR: 8263635: Add --prefix option to jhsdb debugd [v2]

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue May 11 01:36:58 UTC 2021


On Tue, 11 May 2021 00:52:12 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>> 
>>  - Update jhsdb man page
>>  - Merge remote-tracking branch 'upstream/master' into JDK-8263635
>>  - Update help message
>>  - 8263635: Add --prefix option to jhsdb debugd
>
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/RMIHelper.java line 93:
> 
>> 91: 
>> 92:     public static Remote lookup(String debugServerID) throws DebuggerException {
>> 93:         // debugServerID follows the pattern [unique_id@]host[:port][/prefix]
> 
> It's a bit unclear to me why we need both a "unique_id" and a "prefix". I understand that the SA already append the two, and that previously the prefix was a constant, but I don't see why the user would ever need to set the "prefix" when they can always specify a "unique_id" that is truly unique. What is the use case for this?

"prefix" is similar to "unique_id" as you said, but it is useful to group debugees.

For example, the host runs 2 container pods as following:

* Pod A
    * Container 1
    * Container 2
    * Container 3
* Pod B
    * Container 1
    * Container 2
    * Container 3

If we want to compare 2 pods with jhsdb, we can set ID like "A-1", "B-1".
However, if the prefix is supported on jhsdb, we can set ID and prefix like "1 at localhost/A", "1 at localhost/B". I think it is easy to understand.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3669


More information about the serviceability-dev mailing list