1 //-------------------------------------------------------------------------- 2 // Copyright (C) 2015-2021 Cisco and/or its affiliates. All rights reserved. 3 // 4 // This program is free software; you can redistribute it and/or modify it 5 // under the terms of the GNU General Public License Version 2 as published 6 // by the Free Software Foundation. You may not use, modify or distribute 7 // this program under any other version of the GNU General Public License. 8 // 9 // This program is distributed in the hope that it will be useful, but 10 // WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 // General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License along 15 // with this program; if not, write to the Free Software Foundation, Inc., 16 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 //-------------------------------------------------------------------------- 18 19 // profiler.h author Joel Cornett <jocornet@cisco.com> 20 21 #ifndef PROFILER_H 22 #define PROFILER_H 23 24 #include "main/thread.h" 25 #include "profiler_defs.h" 26 27 namespace snort 28 { 29 class Module; 30 } 31 32 class Profiler 33 { 34 public: 35 static void register_module(snort::Module*); 36 static void register_module(const char*, const char*, snort::Module*); 37 38 static void start(); 39 static void stop(uint64_t); 40 41 static void consolidate_stats(); 42 43 static void reset_stats(); 44 static void show_stats(); 45 }; 46 47 extern THREAD_LOCAL snort::ProfileStats totalPerfStats; 48 extern THREAD_LOCAL snort::ProfileStats otherPerfStats; 49 50 #endif 51