Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/gpu/drm/i915/gt/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  intel_engine_stats.h   Sprache: C

 
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2020 Intel Corporation
 */


#ifndef __INTEL_ENGINE_STATS_H__
#define __INTEL_ENGINE_STATS_H__

#include <linux/atomic.h>
#include <linux/ktime.h>
#include <linux/seqlock.h>

#include "i915_gem.h" /* GEM_BUG_ON */
#include "intel_engine.h"

static inline void intel_engine_context_in(struct intel_engine_cs *engine)
{
 struct intel_engine_execlists_stats *stats = &engine->stats.execlists;
 unsigned long flags;

 if (stats->active) {
  stats->active++;
  return;
 }

 /* The writer is serialised; but the pmu reader may be from hardirq */
 local_irq_save(flags);
 write_seqcount_begin(&stats->lock);

 stats->start = ktime_get();
 stats->active++;

 write_seqcount_end(&stats->lock);
 local_irq_restore(flags);

 GEM_BUG_ON(!stats->active);
}

static inline void intel_engine_context_out(struct intel_engine_cs *engine)
{
 struct intel_engine_execlists_stats *stats = &engine->stats.execlists;
 unsigned long flags;

 GEM_BUG_ON(!stats->active);
 if (stats->active > 1) {
  stats->active--;
  return;
 }

 local_irq_save(flags);
 write_seqcount_begin(&stats->lock);

 stats->active--;
 stats->total = ktime_add(stats->total,
     ktime_sub(ktime_get(), stats->start));

 write_seqcount_end(&stats->lock);
 local_irq_restore(flags);
}

#endif /* __INTEL_ENGINE_STATS_H__ */

Messung V0.5
C=94 H=89 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.