Changeset 5fc727f in rtems


Ignore:
Timestamp:
Nov 26, 2018, 7:25:36 AM (8 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6378978
Parents:
eaa5ea84
git-author:
Sebastian Huber <sebastian.huber@…> (11/26/18 07:25:36)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/26/18 07:29:33)
Message:

score: <rtems/score/smplockstats.h>

Remove <rtems/score/chainimpl.h> include from
<rtems/score/smplockstats.h>.

Close #3598.

Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/smplockstats.h

    reaa5ea84 r5fc727f  
    88
    99/*
    10  * Copyright (c) 2013, 2016 embedded brains GmbH
     10 * Copyright (c) 2013, 2018 embedded brains GmbH
    1111 *
    1212 * The license and distribution terms for this file may be
     
    1818#define _RTEMS_SCORE_SMPLOCKSTATS_H
    1919
    20 #include <rtems/score/cpuopts.h>
     20#include <rtems/score/cpu.h>
    2121
    2222#if defined(RTEMS_SMP)
    2323
    24 #if defined(RTEMS_PROFILING)
    25 #include <rtems/score/chainimpl.h>
    26 
    27 #include <stdint.h>
    28 #endif
     24#include <rtems/score/chain.h>
    2925
    3026#ifdef __cplusplus
     
    172168void _SMP_lock_Stats_destroy( SMP_lock_Stats *stats );
    173169
    174 void _SMP_lock_Stats_register( SMP_lock_Stats *stats );
     170void _SMP_lock_Stats_register_or_max_section_time(
     171  SMP_lock_Stats    *stats,
     172  CPU_Counter_ticks  max_section_time
     173);
    175174
    176175typedef struct {
     
    224223)
    225224{
    226   SMP_lock_Stats *stats = stats_context->stats;
    227   CPU_Counter_ticks first = stats_context->acquire_instant;
    228   CPU_Counter_ticks second = _CPU_Counter_read();
    229   CPU_Counter_ticks delta = _CPU_Counter_difference( second, first );
     225  SMP_lock_Stats    *stats;
     226  CPU_Counter_ticks  first;
     227  CPU_Counter_ticks  second;
     228  CPU_Counter_ticks  delta;
     229
     230  stats = stats_context->stats;
     231  first = stats_context->acquire_instant;
     232  second = _CPU_Counter_read();
     233  delta = _CPU_Counter_difference( second, first );
    230234
    231235  stats->total_section_time += delta;
    232236
    233237  if ( stats->max_section_time < delta ) {
    234     stats->max_section_time = delta;
    235 
    236     if ( _Chain_Is_node_off_chain( &stats->Node ) ) {
    237       _SMP_lock_Stats_register( stats );
    238     }
     238    _SMP_lock_Stats_register_or_max_section_time( stats, delta );
    239239  }
    240240}
  • cpukit/score/src/profilingsmplock.c

    reaa5ea84 r5fc727f  
    11/*
    2  * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2014, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    1818
    1919#include <rtems/score/smplock.h>
     20#include <rtems/score/chainimpl.h>
    2021
    2122#include <string.h>
     
    8283}
    8384
    84 void _SMP_lock_Stats_register( SMP_lock_Stats *stats )
     85void _SMP_lock_Stats_register_or_max_section_time(
     86  SMP_lock_Stats    *stats,
     87  CPU_Counter_ticks  max_section_time
     88)
    8589{
    86       SMP_lock_Stats_control *control = &_SMP_lock_Stats_control;
    87       SMP_lock_Context lock_context;
     90  stats->max_section_time = max_section_time;
    8891
    89       _SMP_lock_ISR_disable_and_acquire( &control->Lock, &lock_context );
    90       _Chain_Append_unprotected( &control->Stats_chain, &stats->Node );
    91       _SMP_lock_Release_and_ISR_enable( &control->Lock, &lock_context );
     92  if ( _Chain_Is_node_off_chain( &stats->Node ) ) {
     93    SMP_lock_Stats_control *control;
     94    SMP_lock_Context        lock_context;
     95
     96    control = &_SMP_lock_Stats_control;
     97    _SMP_lock_ISR_disable_and_acquire( &control->Lock, &lock_context );
     98    _Chain_Append_unprotected( &control->Stats_chain, &stats->Node );
     99    _SMP_lock_Release_and_ISR_enable( &control->Lock, &lock_context );
     100  }
    92101}
    93102
Note: See TracChangeset for help on using the changeset viewer.