Skip to content

Commit e7d6c7f

Browse files
Aditya Sharatfacebook-github-bot
authored andcommitted
improves naming systrace blocks
Summary: Improves naming systrace blocks. For example: Now the component mentioned in create-layout block matches with the component mentioned in the measure tree block Reviewed By: astreet Differential Revision: D32998751 fbshipit-source-id: 5c253570a13d270b496b3128f7adfa1f3d29a3c0
1 parent bf9c0fb commit e7d6c7f

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

litho-core/src/main/java/com/facebook/litho/InternalNodeUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static LithoRenderUnit createDrawableRenderUnit(
290290
/* Call onBoundsDefined for the DrawableComponent */
291291
final boolean isTracing = ComponentsSystrace.isTracing();
292292
if (isTracing) {
293-
ComponentsSystrace.beginSection("onBoundsDefined:" + node.getSimpleName());
293+
ComponentsSystrace.beginSection("onBoundsDefined:" + component.getSimpleName());
294294
}
295295

296296
try {

litho-core/src/main/java/com/facebook/litho/Layout.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ static LithoLayoutResult measure(
488488

489489
final boolean isTracing = ComponentsSystrace.isTracing();
490490
if (isTracing) {
491-
ComponentsSystrace.beginSection("measureTree:" + root.getSimpleName());
491+
ComponentsSystrace.beginSection(
492+
"measureTree:" + Preconditions.checkNotNull(root.getHeadComponent()).getSimpleName());
492493
}
493494

494495
if (diff != null && root.implementsLayoutDiffing()) {

litho-core/src/main/java/com/facebook/litho/LayoutState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ private static void collectResults(
554554
// If the nested tree is defined, it has been resolved during a measure call during
555555
// layout calculation.
556556
if (isTracing) {
557-
ComponentsSystrace.beginSectionWithArgs("resolveNestedTree:" + node.getSimpleName())
557+
ComponentsSystrace.beginSectionWithArgs("resolveNestedTree:" + component.getSimpleName())
558558
.arg("widthSpec", "EXACTLY " + result.getWidth())
559559
.arg("heightSpec", "EXACTLY " + result.getHeight())
560560
.arg("rootComponentId", node.getTailComponent().getId())
@@ -693,7 +693,7 @@ private static void collectResults(
693693

694694
// Notify component about its final size.
695695
if (isTracing) {
696-
ComponentsSystrace.beginSection("onBoundsDefined:" + node.getSimpleName());
696+
ComponentsSystrace.beginSection("onBoundsDefined:" + component.getSimpleName());
697697
}
698698

699699
try {

litho-core/src/main/java/com/facebook/litho/LithoYogaMeasureFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public long measure(
100100

101101
try {
102102
if (isTracing) {
103-
ComponentsSystrace.beginSection("resolveNestedTree:" + node.getSimpleName());
103+
ComponentsSystrace.beginSection("resolveNestedTree:" + component.getSimpleName());
104104
}
105105

106106
final @Nullable LithoLayoutResult nestedTree =

0 commit comments

Comments
 (0)