ui: simplify "io.ufs.command.tags" track grouping

The initial reason for the change was being bothered that the UI shows
the first track as the summary track (`ufsCmdTagTracks[0].key =
summaryTrackKey;`), which often looks like a glitch rather than a
feature.

Change-Id: Ib8afb5326a4898388a74630d87408f825160a36e
diff --git a/ui/src/controller/track_decider.ts b/ui/src/controller/track_decider.ts
index d61d7c4..ce817db 100644
--- a/ui/src/controller/track_decider.ts
+++ b/ui/src/controller/track_decider.ts
@@ -90,9 +90,9 @@
 const F2FS_IOSTAT_LAT_GROUP_NAME = 'f2fs_iostat_latency';
 const DISK_IOSTAT_TAG = 'diskstat.';
 const DISK_IOSTAT_GROUP_NAME = 'diskstat';
-const UFS_CMD_TAG = 'io.ufs.command.tag';
-const UFS_CMD_TAG_GROUP_NAME = 'io.ufs.command.tags';
 const BUDDY_INFO_TAG = 'mem.buddyinfo';
+const UFS_CMD_TAG_REGEX = new RegExp('^io.ufs.command.tag.*$');
+const UFS_CMD_TAG_GROUP = 'io.ufs.command.tags';
 // NB: Userspace wakelocks start with "WakeLock" not "Wakelock".
 const KERNEL_WAKELOCK_REGEX = new RegExp('^Wakelock.*$');
 const KERNEL_WAKELOCK_GROUP = 'Kernel wakelocks';
@@ -469,35 +469,6 @@
     }
   }
 
-  async groupGlobalUfsCmdTagTracks(tag: string, group: string): Promise<void> {
-    const ufsCmdTagTracks: AddTrackArgs[] = [];
-
-    for (const track of this.tracksToAdd) {
-      if (track.name.startsWith(tag)) {
-        ufsCmdTagTracks.push(track);
-      }
-    }
-
-    if (ufsCmdTagTracks.length === 0) {
-      return;
-    }
-
-    const id = uuidv4();
-    const summaryTrackKey = uuidv4();
-    ufsCmdTagTracks[0].key = summaryTrackKey;
-    for (const track of ufsCmdTagTracks) {
-      track.trackGroup = id;
-    }
-
-    const addGroup = Actions.addTrackGroup({
-      summaryTrackKey,
-      name: group,
-      id,
-      collapsed: true,
-    });
-    this.addTrackGroupActions.push(addGroup);
-  }
-
   async groupGlobalBuddyInfoTracks(): Promise<void> {
     const buddyInfoTracks: AddTrackArgs[] = [];
     const devMap = new Map<string, string>();
@@ -1782,7 +1753,7 @@
     await this.groupGlobalIostatTracks(
       F2FS_IOSTAT_LAT_TAG, F2FS_IOSTAT_LAT_GROUP_NAME);
     await this.groupGlobalIostatTracks(DISK_IOSTAT_TAG, DISK_IOSTAT_GROUP_NAME);
-    await this.groupGlobalUfsCmdTagTracks(UFS_CMD_TAG, UFS_CMD_TAG_GROUP_NAME);
+    await this.groupTracksByRegex(UFS_CMD_TAG_REGEX, UFS_CMD_TAG_GROUP);
     await this.groupGlobalBuddyInfoTracks();
     await this.groupTracksByRegex(KERNEL_WAKELOCK_REGEX, KERNEL_WAKELOCK_GROUP);
     await this.groupTracksByRegex(NETWORK_TRACK_REGEX, NETWORK_TRACK_GROUP);