"Fossies" - the Fresh Open Source Software Archive

Member "sysdig-0.26.1/userspace/sysdig/sysdig.h" (24 May 2019, 1949 Bytes) of package /linux/misc/sysdig-0.26.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "sysdig.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.24.2_vs_0.25.

    1 /*
    2 Copyright (C) 2013-2018 Draios Inc dba Sysdig.
    3 
    4 This file is part of sysdig.
    5 
    6 Licensed under the Apache License, Version 2.0 (the "License");
    7 you may not use this file except in compliance with the License.
    8 You may obtain a copy of the License at
    9 
   10     http://www.apache.org/licenses/LICENSE-2.0
   11 
   12 Unless required by applicable law or agreed to in writing, software
   13 distributed under the License is distributed on an "AS IS" BASIS,
   14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15 See the License for the specific language governing permissions and
   16 limitations under the License.
   17 
   18 */
   19 
   20 #pragma once
   21 
   22 #include <config_sysdig.h>
   23 #ifdef HAS_CAPTURE
   24 #include "../../driver/driver_config.h"
   25 #endif // HAS_CAPTURE
   26 
   27 //
   28 // ASSERT implementation
   29 //
   30 #ifdef _DEBUG
   31 #define ASSERT(X) assert(X)
   32 #else // _DEBUG
   33 #define ASSERT(X)
   34 #endif // _DEBUG
   35 
   36 //
   37 // Capture results
   38 //
   39 class sysdig_init_res
   40 {
   41 public:
   42     sysdig_init_res()
   43     {
   44         m_res = EXIT_SUCCESS;
   45     }
   46 
   47     sysdig_init_res(int res)
   48     {
   49         m_res = res;
   50     }
   51 
   52     int m_res;
   53     vector<string> m_next_run_args;
   54 };
   55 
   56 //
   57 // Capture results
   58 //
   59 class captureinfo
   60 {
   61 public:
   62     captureinfo()
   63     {
   64         m_nevts = 0;
   65         m_time = 0;
   66     }
   67 
   68     uint64_t m_nevts;
   69     uint64_t m_time;
   70 };
   71 
   72 //
   73 // Summary table entry
   74 //
   75 class summary_table_entry
   76 {
   77 public:
   78     summary_table_entry(uint16_t id, bool is_unsupported_syscall) : m_ncalls(0), m_id(id), m_is_unsupported_syscall(is_unsupported_syscall)
   79     {
   80     }
   81 
   82     uint64_t m_ncalls;
   83     uint16_t m_id;
   84     bool m_is_unsupported_syscall;  
   85 };
   86 
   87 struct summary_table_entry_rsort_comparer
   88 {
   89     bool operator() (const summary_table_entry& first, const summary_table_entry& second) const 
   90     {
   91         return first.m_ncalls > second.m_ncalls;
   92     }
   93 };
   94 
   95 //
   96 // Printer functions
   97 //
   98 void list_fields(bool verbose, bool markdown, bool names_only=false);
   99 void list_events(sinsp* inspector);
  100 
  101 #ifdef HAS_CHISELS
  102 void print_chisel_info(chisel_desc* cd);
  103 void list_chisels(vector<chisel_desc>* chlist, bool verbose);
  104 #endif
  105 
  106 
  107