/*
 * Copyright (C) 2022 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 at
 *
 *      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.
 */

syntax = "proto2";

package perfetto.protos;

// Translation rules for the trace processor.
// See the comments for each rule type for specific meaning.
message TranslationTable {
  oneof table {
    ChromeHistorgramTranslationTable chrome_histogram = 1;
    ChromeUserEventTranslationTable chrome_user_event = 2;
    ChromePerformanceMarkTranslationTable chrome_performance_mark = 3;
    SliceNameTranslationTable slice_name = 4;
    ProcessTrackNameTranslationTable process_track_name = 5;
    ChromeStudyTranslationTable chrome_study = 6;
  }
}

// Chrome histogram sample hash -> name translation rules.
message ChromeHistorgramTranslationTable {
  map<uint64, string> hash_to_name = 1;
}

// Chrome user event action hash -> name translation rules.
message ChromeUserEventTranslationTable {
  map<uint64, string> action_hash_to_name = 1;
}

// Chrome performance mark translation rules.
message ChromePerformanceMarkTranslationTable {
  map<uint32, string> site_hash_to_name = 1;
  map<uint32, string> mark_hash_to_name = 2;
};

// Raw -> deobfuscated slice name translation rules.
message SliceNameTranslationTable {
  map<string, string> raw_to_deobfuscated_name = 1;
};

// Raw -> deobfuscated process track name translation rules.
message ProcessTrackNameTranslationTable {
  map<string, string> raw_to_deobfuscated_name = 1;
};

// Chrome study hash -> name translation rules.
message ChromeStudyTranslationTable {
  map<uint64, string> hash_to_name = 1;
};
