Changeset d5ead0cf4d18db940685ff9a33847629bc796330

Show
Ignore:
Timestamp:
08/09/11 01:32:46 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1312853566 -0400
git-parent:

[7ab9795e96359cb90db2acb8b38293dcefd34e62], [bb853610800c56a28a11f153a26829c36195d576]

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

Merge branch 'master' into dtrace

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/jlog/jlog_io.c

    rcc981f5 re153d26  
    8282  if (stat(path, &sb) == 0) { 
    8383    if (!S_ISREG(sb.st_mode)) goto out; 
     84    memset(&id, 0, sizeof(id)); 
    8485    id.st_dev = sb.st_dev; 
    8586    id.st_ino = sb.st_ino; 
  • src/noit_check_log.c

    r076670c r9e09385  
    350350  } 
    351351 
    352   bundle.metrics = malloc(bundle.n_metrics * sizeof(Metric*)); 
    353  
    354   // Now convert 
    355   while(noit_hash_next(&c->metrics, &iter2, &key, &klen, &vm)) { 
    356     /* If we apply the filter set and it returns false, we don't log */ 
    357     metric_t *m = (metric_t *)vm; 
    358     bundle.metrics[i] = malloc(sizeof(Metric)); 
    359     metric__init(bundle.metrics[i]); 
    360     _noit_check_log_bundle_metric(ls, bundle.metrics[i], m); 
    361     i++; 
     352  if(bundle.n_metrics > 0) { 
     353    bundle.metrics = malloc(bundle.n_metrics * sizeof(Metric*)); 
     354 
     355    // Now convert 
     356    while(noit_hash_next(&c->metrics, &iter2, &key, &klen, &vm)) { 
     357      /* If we apply the filter set and it returns false, we don't log */ 
     358      metric_t *m = (metric_t *)vm; 
     359      bundle.metrics[i] = malloc(sizeof(Metric)); 
     360      metric__init(bundle.metrics[i]); 
     361      _noit_check_log_bundle_metric(ls, bundle.metrics[i], m); 
     362      i++; 
     363    } 
    362364  } 
    363365 
  • src/noit_check_log_helpers.c

    ra423b8a rbb85361  
    4848                                   unsigned int * len_out) { 
    4949  uLong initial_dlen, dlen; 
    50   char *compbuff, *b64buff; 
     50  char *compbuff = NULL, *b64buff; 
    5151 
    5252  // Compress saves 25% of space (ex 470 -> 330) 
  • src/noit_check_tools_shared.c

    rb553f9a r9e09385  
    138138                             char *name, int name_len, 
    139139                             char *uuid, int uuid_len) { 
     140  if(!in || len == 0) return; 
    140141  if(target) *target = '\0'; 
    141142  if(module) *module = '\0'; 
    142143  if(name) *name = '\0'; 
    143144  if(uuid) *uuid = '\0'; 
    144   if(len >= UUID_STR_LEN) { 
     145  if(uuid && len >= UUID_STR_LEN) { 
    145146    memcpy(uuid, in + len - UUID_STR_LEN, UUID_STR_LEN); 
    146147    uuid[UUID_STR_LEN] = '\0'; 
     
    153154    if(!mcp) return; 
    154155    /* copy in the target */ 
    155     if(target_len > mcp-tcp) { 
     156    if(target && target_len > mcp-tcp) { 
    156157      memcpy(target,tcp,mcp-tcp); 
    157158      target[mcp-tcp] = '\0'; 
     
    161162    if(!ncp) return; 
    162163    /* copy in the module */ 
    163     if(module_len > ncp-mcp) { 
     164    if(module && module_len > ncp-mcp) { 
    164165      memcpy(module,mcp,ncp-mcp); 
    165166      module[ncp-mcp] = '\0'; 
     
    169170    ucp = in + len - UUID_STR_LEN - 1; 
    170171    if(ncp < ucp) { 
    171       if(name_len > ucp-ncp) { 
     172      if(name && name_len > ucp-ncp) { 
    172173        memcpy(name, ncp, ucp-ncp); 
    173174        name[ucp-ncp] = '\0'; 
  • src/stratcon_jlog_streamer.c

    r1ff1395 rd5ead0c  
    11201120                                                  "connecting")); 
    11211121  push_noit_m_u64("last_event_age_ms", last_event_ms); 
    1122   push_noit_m_u64("session_length_ms", last_event_ms); 
     1122  push_noit_m_u64("session_length_ms", session_duration_ms); 
    11231123} 
    11241124static int