Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  opal-tracepoints.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
#include <linux/percpu.h>
#include <linux/jump_label.h>
#include <asm/trace.h>

#ifdef CONFIG_JUMP_LABEL
struct static_key opal_tracepoint_key = STATIC_KEY_INIT;

int opal_tracepoint_regfunc(void)
{
 static_key_slow_inc(&opal_tracepoint_key);
 return 0;
}

void opal_tracepoint_unregfunc(void)
{
 static_key_slow_dec(&opal_tracepoint_key);
}
#else
/*
 * We optimise OPAL calls by placing opal_tracepoint_refcount
 * directly in the TOC so we can check if the opal tracepoints are
 * enabled via a single load.
 */


/* NB: reg/unreg are called while guarded with the tracepoints_mutex */
extern long opal_tracepoint_refcount;

int opal_tracepoint_regfunc(void)
{
 opal_tracepoint_refcount++;
 return 0;
}

void opal_tracepoint_unregfunc(void)
{
 opal_tracepoint_refcount--;
}
#endif

/*
 * Since the tracing code might execute OPAL calls we need to guard against
 * recursion.
 */

static DEFINE_PER_CPU(unsigned int, opal_trace_depth);

void __trace_opal_entry(unsigned long opcode, unsigned long *args)
{
 unsigned long flags;
 unsigned int *depth;

 local_irq_save(flags);

 depth = this_cpu_ptr(&opal_trace_depth);

 if (*depth)
  goto out;

 (*depth)++;
 preempt_disable();
 trace_opal_entry(opcode, args);
 (*depth)--;

out:
 local_irq_restore(flags);
}

void __trace_opal_exit(long opcode, unsigned long retval)
{
 unsigned long flags;
 unsigned int *depth;

 local_irq_save(flags);

 depth = this_cpu_ptr(&opal_trace_depth);

 if (*depth)
  goto out;

 (*depth)++;
 trace_opal_exit(opcode, retval);
 preempt_enable();
 (*depth)--;

out:
 local_irq_restore(flags);
}

Messung V0.5
C=97 H=92 G=94

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge