-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "tp: UI uses TrackDescriptor ordered tracks" into main
- Loading branch information
Showing
7 changed files
with
342 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (C) 2023 The Android Open Source Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License a | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from python.generators.diff_tests.testing import Path, DataPath, Metric | ||
from python.generators.diff_tests.testing import Csv, Json, TextProto | ||
from python.generators.diff_tests.testing import DiffTestBlueprint, TraceInjector | ||
from python.generators.diff_tests.testing import TestSuite | ||
|
||
|
||
class Viz(TestSuite): | ||
|
||
def test_track_event_tracks_ordering(self): | ||
return DiffTestBlueprint( | ||
trace=Path('track_event_tracks_ordering.textproto'), | ||
query=""" | ||
SELECT | ||
id, | ||
parent_id, | ||
EXTRACT_ARG(source_arg_set_id, 'child_ordering') AS ordering, | ||
EXTRACT_ARG(source_arg_set_id, 'sibling_order_z_index') AS z_index | ||
FROM track; | ||
""", | ||
out=Csv(""" | ||
"id","parent_id","ordering","z_index" | ||
0,"[NULL]","explicit",-10 | ||
1,0,"[NULL]","[NULL]" | ||
2,0,"[NULL]",5 | ||
3,0,"[NULL]",-5 | ||
4,"[NULL]","chronological","[NULL]" | ||
5,4,"[NULL]","[NULL]" | ||
6,4,"[NULL]","[NULL]" | ||
7,4,"[NULL]","[NULL]" | ||
8,0,"[NULL]",-5 | ||
9,"[NULL]","lexicographic","[NULL]" | ||
10,9,"[NULL]","[NULL]" | ||
11,9,"[NULL]","[NULL]" | ||
12,9,"[NULL]","[NULL]" | ||
13,9,"[NULL]","[NULL]" | ||
""")) | ||
|
||
def test_all_tracks_ordered(self): | ||
return DiffTestBlueprint( | ||
trace=Path('track_event_tracks_ordering.textproto'), | ||
query=""" | ||
INCLUDE PERFETTO MODULE viz.summary.tracks; | ||
SELECT id, order_id | ||
FROM _track_event_tracks_ordered | ||
ORDER BY id; | ||
""", | ||
out=Csv(""" | ||
"id","order_id" | ||
1,4 | ||
2,3 | ||
3,1 | ||
5,1 | ||
6,2 | ||
7,3 | ||
8,2 | ||
10,1 | ||
11,2 | ||
12,4 | ||
13,3 | ||
""")) |
163 changes: 163 additions & 0 deletions
163
test/trace_processor/diff_tests/stdlib/viz/track_event_tracks_ordering.textproto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
# Explicit tracks. | ||
|
||
## Parent | ||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 0 | ||
incremental_state_cleared: true | ||
first_packet_on_sequence: true | ||
track_descriptor { | ||
uuid: 100 | ||
child_ordering: 3 | ||
name: "explicit_parent" | ||
sibling_order_z_index: -10 | ||
} | ||
trace_packet_defaults { | ||
track_event_defaults { | ||
track_uuid: 1 | ||
} | ||
} | ||
} | ||
|
||
## Children | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 0 | ||
incremental_state_cleared: true | ||
first_packet_on_sequence: true | ||
track_descriptor { | ||
uuid: 2 | ||
parent_uuid: 100 | ||
name: "explicit_child:no z-index" | ||
} | ||
trace_packet_defaults { | ||
track_event_defaults { | ||
track_uuid: 2 | ||
} | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 0 | ||
track_descriptor { | ||
uuid: 3 | ||
parent_uuid: 100 | ||
name: "explicit_child:5 z-index" | ||
sibling_order_z_index: 5 | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 0 | ||
track_descriptor { | ||
uuid: 4 | ||
parent_uuid: 100 | ||
name: "explicit_child:-5 z-index" | ||
sibling_order_z_index: -5 | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 100 | ||
track_descriptor { | ||
uuid: 5 | ||
parent_uuid: 100 | ||
name: "explicit_child:-5 z-index" | ||
sibling_order_z_index: -5 | ||
} | ||
} | ||
|
||
# Lexicographic tracks. | ||
|
||
## Parent | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 200 | ||
track_descriptor { | ||
uuid: 200 | ||
child_ordering: 1 | ||
name: "lexicographic_parent" | ||
} | ||
} | ||
|
||
## Children | ||
|
||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 200 | ||
track_descriptor { | ||
uuid: 6 | ||
parent_uuid: 200 | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 1000 | ||
track_descriptor { | ||
uuid: 7 | ||
parent_uuid: 200 | ||
name: "a" | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 2000 | ||
track_descriptor { | ||
uuid: 8 | ||
parent_uuid: 200 | ||
name: "b" | ||
} | ||
} | ||
# Should appear on overridden track "t2". | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 2000 | ||
track_descriptor { | ||
uuid: 9 | ||
parent_uuid: 200 | ||
name: "ab" | ||
} | ||
} | ||
|
||
# Chronological tracks. | ||
|
||
## Parent | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 1000 | ||
track_descriptor { | ||
uuid: 300 | ||
child_ordering: 2 | ||
name: "chronological_parent" | ||
} | ||
} | ||
|
||
## Children | ||
|
||
packet { | ||
trusted_packet_sequence_id: 1 | ||
timestamp: 0 | ||
track_descriptor { | ||
uuid: 10 | ||
parent_uuid: 300 | ||
name: "chrono" | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 10 | ||
track_descriptor { | ||
uuid: 11 | ||
parent_uuid: 300 | ||
name: "chrono1" | ||
} | ||
} | ||
packet { | ||
trusted_packet_sequence_id: 2 | ||
timestamp: 5 | ||
track_descriptor { | ||
uuid: 12 | ||
parent_uuid: 300 | ||
name: "chrono2" | ||
} | ||
} |
Oops, something went wrong.