pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin_functions.c,v 1.557 2004/05/18 01:06:46 nilsson Exp $ + || $Id: builtin_functions.c,v 1.558 2004/05/20 20:13:38 grubba Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.557 2004/05/18 01:06:46 nilsson Exp $"); + RCSID("$Id: builtin_functions.c,v 1.558 2004/05/20 20:13:38 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:6465: Inside #if defined(PROFILING)
  {    struct program *prog = 0;    int num_functions;    int i;       if (!args) {    SIMPLE_TOO_FEW_ARGS_ERROR("get_profiling_info", 1);    }    prog = program_from_svalue(Pike_sp-args);    if(!prog) -  SIMPLE_BAD_ARG_ERROR("get_profiling_info", 1, "program|function|object"); +  SIMPLE_BAD_ARG_ERROR("get_profiling_info", 1, "program");       /* ({ num_clones, ([ "fun_name":({ num_calls, total_time, self_time }) ]) })    */       pop_n_elems(args-1);    args = 1;       push_int(prog->num_clones);       for(num_functions=i=0; i<(int)prog->num_identifiers; i++) {    if (prog->identifiers[i].num_calls)    {    num_functions++;    ref_push_string(prog->identifiers[i].name);       push_int(prog->identifiers[i].num_calls); -  push_int(prog->identifiers[i].total_time); -  push_int(prog->identifiers[i].self_time); +  if (CPU_TIME_TICKS == 1000) { +  push_int64(prog->identifiers[i].total_time); +  push_int64(prog->identifiers[i].self_time); +  } else { +  push_int64(prog->identifiers[i].total_time/1000000); +  push_int64(prog->identifiers[i].self_time/1000000); +  }    f_aggregate(3);    }    }    f_aggregate_mapping(num_functions * 2);    f_aggregate(2);       stack_swap();    pop_stack();   }   #endif /* PROFILING */