JMC-6222 Allow filtering by package for the Method Profiling Rule

Joshua Matsuoka jmatsuok at redhat.com
Wed Dec 5 15:37:34 UTC 2018


Hi Marcus,

Thanks for the review! Here's an exported patch, Mario could you sponsor it?

Cheers,

- Josh

On Wed, Dec 5, 2018 at 4:09 AM Marcus Hirt <marcus.hirt at oracle.com> wrote:

> Looks good Josh!
>
>
>
> /M
>
>
>
> *From: *Joshua Matsuoka <jmatsuok at redhat.com>
> *Date: *Tuesday, 4 December 2018 at 22:44
> *To: *<marcus at hirt.se>
> *Cc: *Marcus Hirt <marcus.hirt at oracle.com>, <jmc-dev at openjdk.java.net>
> *Subject: *Re: JMC-6222 Allow filtering by package for the Method
> Profiling Rule
>
>
>
> Hi Marcus,
>
>
>
> Here's an updated patch.
>
>
>
> http://cr.openjdk.java.net/~jmatsuoka/JMC-6222/webrev.02/
>
>
>
> Cheers,
>
>
>
> - Josh
>
>
>
> On Mon, Dec 3, 2018 at 1:36 PM Marcus Hirt <marcus at hirt.se> wrote:
>
> Hi Josh,
>
> Probably just want to look at the package:
>
> MethodProfilingRule at 454:
> Matcher m =
> excludes.matcher(frame.getMethod().getType().getPackage().getName());
>
> I think it would be nice to add the following as default:
>         public static final TypedPreference<String>
> EXCLUDED_PACKAGE_REGEXP = new TypedPreference<>(
>                         "method.profiling.evaluation.excluded.package",
> //$NON-NLS-1$
>
> Messages.getString(Messages.MethodProfilingRule_EXCLUDED_PACKAGES),
>
> Messages.getString(Messages.MethodProfilingRule_EXCLUDED_PACKAGES_DESC),
>                         UnitLookup.PLAIN_TEXT.getPersister(),
> "java\\.(lang|util)");
>
>
> Kind regards,
> Marcus
>
> -----Ursprungligt meddelande-----
> Från: jmc-dev <jmc-dev-bounces at openjdk.java.net> För Joshua Matsuoka
> Skickat: den 3 december 2018 17:53
> Till: Marcus Hirt <marcus.hirt at oracle.com>
> Kopia: jmc-dev at openjdk.java.net
> Ämne: Re: JMC-6222 Allow filtering by package for the Method Profiling Rule
>
> Hi Marcus,
>
> Here's an updated webrev:
> http://cr.openjdk.java.net/~jmatsuoka/JMC-6222/webrev.01/
>
> Cheers,
>
> - Josh
>
> On Fri, Nov 30, 2018 at 5:23 PM Marcus Hirt <marcus.hirt at oracle.com>
> wrote:
>
> > Hi Josh!
> >
> > Quickly tried your patch, but get this:
> > java.util.concurrent.ExecutionException:
> > java.lang.UnsupportedOperationException
> > at java.util.concurrent.FutureTask.report(FutureTask.java:122)
> > at java.util.concurrent.FutureTask.get(FutureTask.java:192)
> > at
> > org.openjdk.jmc.flightrecorder.ui.RuleManager$EvaluateJob.run(RuleMana
> > ger.java:117) at
> > org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
> > Caused by: java.lang.UnsupportedOperationException
> > at java.util.AbstractList.remove(AbstractList.java:161)
> > at java.util.AbstractList$Itr.remove(AbstractList.java:374)
> > at java.util.AbstractCollection.removeAll(AbstractCollection.java:376)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$1
> > $1.processPath(MethodProfilingRule.java:462)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$1
> > $1.getValue(MethodProfilingRule.java:421)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$1
> > $1.getValue(MethodProfilingRule.java:405)
> > at
> > org.openjdk.jmc.common.item.GroupingAggregator$GroupingAggregatorImpl.
> > getValue(GroupingAggregator.java:164)
> > at
> > org.openjdk.jmc.common.item.GroupingAggregator$GroupingAggregatorImpl.
> > getValue(GroupingAggregator.java:134)
> > at
> > org.openjdk.jmc.common.item.Aggregators$MergingAggregator.getValue(Agg
> > regators.java:97)
> > at
> > org.openjdk.jmc.common.item.Aggregators$MergingAggregator.getValue(Agg
> > regators.java:81)
> > at
> > org.openjdk.jmc.flightrecorder.ui.ItemIterableToolkit.aggregate(ItemIt
> > erableToolkit.java:128)
> > at
> > org.openjdk.jmc.flightrecorder.ui.ItemCollectionToolkit$StreamBackedIt
> > emCollection.getAggregate(ItemCollectionToolkit.java:91)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$1
> > .performCalculation(MethodProfilingRule.java:467)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$1
> > .visitWindow(MethodProfilingRule.java:344)
> > at
> > org.openjdk.jmc.flightrecorder.rules.util.SlidingWindowToolkit.sliding
> > WindowUnordered(SlidingWindowToolkit.java:200)
> > at
> > org.openjdk.jmc.flightrecorder.rules.util.SlidingWindowToolkit.sliding
> > WindowUnordered(SlidingWindowToolkit.java:158)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule.g
> > etResult(MethodProfilingRule.java:239)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule.a
> > ccess$000(MethodProfilingRule.java:97)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$M
> > ethodProfilingCallable.call(MethodProfilingRule.java:196)
> > at
> > org.openjdk.jmc.flightrecorder.rules.jdk.latency.MethodProfilingRule$M
> > ethodProfilingCallable.call(MethodProfilingRule.java:184)
> > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> > at java.lang.Thread.run(Thread.java:748)
> >
> > The regexp used:
> > java\.util\..*
> > And input file:
> > The "before" file from here:
> >
> > https://github.com/thegreystone/jmc-tutorial/tree/master/projects/02_J
> > FR_HotMethods
> >
> > Kind regards,
> > Marcus
> >
> > On 2018-11-30, 17:25, "jmc-dev on behalf of Joshua Matsuoka" <
> > jmc-dev-bounces at openjdk.java.net on behalf of jmatsuok at redhat.com>
> wrote:
> >
> >     Hi,
> >
> >     The following patch adds support for filtering the method
> > profiling rule by
> >     package name. When a regex is supplied via TypedPreferences, it
> > will drop
> >     any frames matching the regex until reaching the first one that
> doesnt
> >     match, treating that one as the hot frame.
> >
> >     http://cr.openjdk.java.net/~jmatsuoka/JMC-6222/webrev.00/jmc.patch
> >
> >     Thoughts?
> >
> >     Bug ID:
> >
> > https://bugs.openjdk.java.net/projects/JMC/issues/JMC-6222?filter=allo
> > penissues
> >
> >     Cheers,
> >
> >     - Josh
> >
> >
> >
> >
> >
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JMC-6222.patch
Type: text/x-patch
Size: 11334 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/jmc-dev/attachments/20181205/f8805b81/JMC-6222-0001.patch>


More information about the jmc-dev mailing list