branch stack reader needs updating for new information

Aperta
#151 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, linux

Direzione di ricerca

Inizia dalla definizione di perf_branch_entry in src/quipper/kernel/perf_event.h e dalle definizioni corrispondenti di branch_flags e branch_entry in src/quipper/kernel/perf_internals.h. Traccia il modo in cui le voci di branch vengono lette e memorizzate, quindi assicurati che il reader gestisca type, spec, new_type e priv senza trattare i bit validi del kernel come riservati; type 15 deve usare new_type.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The branch stack entry reader will warn about reserved bits being non-zero, so the reader needs to know about all the fields that the kernel is producing:

diff --git a/src/quipper/kernel/perf_event.h b/src/quipper/kernel/perf_event.h
index 9f44a26..2a9ac28 100644
--- a/src/quipper/kernel/perf_event.h
+++ b/src/quipper/kernel/perf_event.h
@@ -1065,7 +1065,11 @@ struct perf_branch_entry {
       in_tx : 1,     /* in transaction */
       abort : 1,     /* transaction abort */
       cycles : 16,   /* cycle count to last branch */
-      reserved : 44;
+      type : 4,      /* branch type, or 15 to indicate new type */
+      spec : 2,      /* speculation outcome */
+      new_type : 4,  /* branch type (new types) */
+      priv : 3,      /* privilege level */
+      reserved : 31;
 };

 }  // namespace quipper
diff --git a/src/quipper/kernel/perf_internals.h b/src/quipper/kernel/perf_internals.h
index 3906e1f..f72122a 100644
--- a/src/quipper/kernel/perf_internals.h
+++ b/src/quipper/kernel/perf_internals.h
@@ -259,7 +259,11 @@ struct branch_flags {
   u64 in_tx : 1;
   u64 abort : 1;
   u64 cycles : 16;
-  u64 reserved : 44;
+  u64 type : 4;
+  u64 spec : 2;
+  u64 new_type : 4;
+  u64 priv : 3;
+  u64 reserved : 31;
 };

 struct branch_entry {

Probably, it should save at least some of this new information in the entry. The 'type' field may be needed by whoever is consuming this infomation, in order to ignore or distinguish some kinds of branches (e.g. interrupts). If type==15, new_type is used as an extended type field.

(Support for 'type' seems to have been added by the recent "update to latest internal version" merge, but "new_type" is still missing and we are already seeing kernels make use of that.)

Lingua principale
C++
Stelle
348
Fork
67
Merge medio
28m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google/perf_data_converter

Tutte le issue di google/perf_data_converter

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.