Changeset b09464ce1fe8fb09f4ad58414507f5b965735967

Show
Ignore:
Timestamp:
08/09/11 02:26:56 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1312856816 -0400
git-parent:

[d5ead0cf4d18db940685ff9a33847629bc796330]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1312856816 -0400
Message:

add metric dtrace logging

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/dtrace_probes.d

    r3aa92a9 rb09464c  
    1818  probe dispatch(char *, char *, char *, char *); 
    1919  probe status(char *, char *, char *, char *, int, int, char *); 
     20  probe metric(char *, char *, char *, char *, char *, int, char *); 
    2021}; 
  • src/dtrace_probes.h

    r574a39b rb09464c  
    250250                __asm__ volatile(""); \ 
    251251                _r; }) 
     252#define NOIT_CHECK_METRIC(arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ 
     253do { \ 
     254        __asm__ volatile(".reference " NOIT_CHECK_TYPEDEFS); \ 
     255        __dtrace_probe$noit_check$metric$v1$63686172202a$63686172202a$63686172202a$63686172202a$63686172202a$696e74$63686172202a(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ 
     256        __asm__ volatile(".reference " NOIT_CHECK_STABILITY); \ 
     257} while (0) 
     258#define NOIT_CHECK_METRIC_ENABLED() \ 
     259        ({ int _r = __dtrace_isenabled$noit_check$metric$v1(); \ 
     260                __asm__ volatile(""); \ 
     261                _r; }) 
    252262#define NOIT_CHECK_STATUS(arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ 
    253263do { \ 
     
    264274extern void __dtrace_probe$noit_check$dispatch$v1$63686172202a$63686172202a$63686172202a$63686172202a(const char *, const char *, const char *, const char *); 
    265275extern int __dtrace_isenabled$noit_check$dispatch$v1(void); 
     276extern void __dtrace_probe$noit_check$metric$v1$63686172202a$63686172202a$63686172202a$63686172202a$63686172202a$696e74$63686172202a(const char *, const char *, const char *, const char *, const char *, int, const char *); 
     277extern int __dtrace_isenabled$noit_check$metric$v1(void); 
    266278extern void __dtrace_probe$noit_check$status$v1$63686172202a$63686172202a$63686172202a$63686172202a$696e74$696e74$63686172202a(const char *, const char *, const char *, const char *, int, int, const char *); 
    267279extern int __dtrace_isenabled$noit_check$status$v1(void); 
     
    273285        } while (0) 
    274286#define NOIT_CHECK_DISPATCH_ENABLED() (0) 
     287#define NOIT_CHECK_METRIC(arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ 
     288do { \ 
     289        } while (0) 
     290#define NOIT_CHECK_METRIC_ENABLED() (0) 
    275291#define NOIT_CHECK_STATUS(arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ 
    276292do { \ 
  • src/noit_check_log.c

    r9e09385 rb09464c  
    3232 
    3333#include "noit_defines.h" 
     34#include "dtrace_probes.h" 
    3435 
    3536#include <uuid/uuid.h> 
     
    360361      metric__init(bundle.metrics[i]); 
    361362      _noit_check_log_bundle_metric(ls, bundle.metrics[i], m); 
     363      if(NOIT_CHECK_METRIC_ENABLED()) { 
     364        char buff[256]; 
     365        noit_stats_snprint_metric(buff, sizeof(buff), m); 
     366        NOIT_CHECK_METRIC(uuid_str, check->module, check->name, check->target, 
     367                          m->metric_name, m->metric_type, buff); 
     368      } 
    362369      i++; 
    363370    } 
     
    421428    SETUP_LOG(metrics, return); 
    422429    _noit_check_log_metric(metrics_log, check, uuid_str, whence, m); 
     430    if(NOIT_CHECK_METRIC_ENABLED()) { 
     431      char buff[256]; 
     432      noit_stats_snprint_metric(buff, sizeof(buff), m); 
     433      NOIT_CHECK_METRIC(uuid_str, check->module, check->name, check->target, 
     434                        m->metric_name, m->metric_type, buff); 
     435    } 
    423436  } 
    424437}