honggfuzz  2.2
About: honggfuzz is a security oriented, feedback-driven, evolutionary, easy-to-use fuzzer with powerful analysis options.
  Fossies Dox: honggfuzz-2.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

display.c File Reference
#include "display.h"
#include <errno.h>
#include <inttypes.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "libhfcommon/common.h"
#include "libhfcommon/log.h"
#include "libhfcommon/util.h"
Include dependency graph for display.c:

Go to the source code of this file.

Macros

#define _WITH_DPRINTF
 
#define ESC_CLEAR_ALL   "\033[2J"
 
#define ESC_CLEAR_LINE   "\033[2K"
 
#define ESC_CLEAR_ABOVE   "\033[1J"
 
#define ESC_TERM_RESET   "\033c"
 
#define ESC_NAV(x, y)   "\033[" #x ";" #y "H"
 
#define ESC_BOLD   "\033[1m"
 
#define ESC_RED   "\033[31m"
 
#define ESC_RESET   "\033[0m"
 
#define ESC_SCROLL_REGION(x, y)   "\033[" #x ";" #y "r"
 
#define ESC_SCROLL_DISABLE   "\033[?7h"
 
#define ESC_SCROLL_RESET   "\033[r"
 
#define ESC_NAV_DOWN(x)   "\033[" #x "B"
 
#define ESC_NAV_HORIZ(x)   "\033[" #x "G"
 
#define ESC_RESET_SETTINGS   "\033[!p"
 

Functions

static void display_start (void)
 
static void display_stop (void)
 
static void display_put (const char *fmt,...)
 
static void display_imm (const char *str)
 
static void display_printKMG (uint64_t val)
 
static unsigned getCpuUse (int numCpus)
 
static void getDuration (time_t elapsed_second, char *buf, size_t bufSz)
 
void display_createTargetStr (honggfuzz_t *hfuzz)
 
void display_display (honggfuzz_t *hfuzz)
 
void display_fini (void)
 
void display_clear (void)
 
void display_init (void)
 

Variables

static char displayBuf [1024 *1024]
 

Macro Definition Documentation

◆ _WITH_DPRINTF

#define _WITH_DPRINTF

Definition at line 25 of file display.c.

◆ ESC_BOLD

#define ESC_BOLD   "\033[1m"

Definition at line 47 of file display.c.

◆ ESC_CLEAR_ABOVE

#define ESC_CLEAR_ABOVE   "\033[1J"

Definition at line 44 of file display.c.

◆ ESC_CLEAR_ALL

#define ESC_CLEAR_ALL   "\033[2J"

Definition at line 42 of file display.c.

◆ ESC_CLEAR_LINE

#define ESC_CLEAR_LINE   "\033[2K"

Definition at line 43 of file display.c.

◆ ESC_NAV

#define ESC_NAV (   x,
 
)    "\033[" #x ";" #y "H"

Definition at line 46 of file display.c.

◆ ESC_NAV_DOWN

#define ESC_NAV_DOWN (   x)    "\033[" #x "B"

Definition at line 53 of file display.c.

◆ ESC_NAV_HORIZ

#define ESC_NAV_HORIZ (   x)    "\033[" #x "G"

Definition at line 54 of file display.c.

◆ ESC_RED

#define ESC_RED   "\033[31m"

Definition at line 48 of file display.c.

◆ ESC_RESET

#define ESC_RESET   "\033[0m"

Definition at line 49 of file display.c.

◆ ESC_RESET_SETTINGS

#define ESC_RESET_SETTINGS   "\033[!p"

Definition at line 55 of file display.c.

◆ ESC_SCROLL_DISABLE

#define ESC_SCROLL_DISABLE   "\033[?7h"

Definition at line 51 of file display.c.

◆ ESC_SCROLL_REGION

#define ESC_SCROLL_REGION (   x,
 
)    "\033[" #x ";" #y "r"

Definition at line 50 of file display.c.

◆ ESC_SCROLL_RESET

#define ESC_SCROLL_RESET   "\033[r"

Definition at line 52 of file display.c.

◆ ESC_TERM_RESET

#define ESC_TERM_RESET   "\033c"

Definition at line 45 of file display.c.

Function Documentation

◆ display_clear()

void display_clear ( void  )

Definition at line 322 of file display.c.

References display_imm(), ESC_CLEAR_ALL, and ESC_NAV_DOWN.

Referenced by display_init(), and mainThreadLoop().

◆ display_createTargetStr()

void display_createTargetStr ( honggfuzz_t hfuzz)

◆ display_display()

void display_display ( honggfuzz_t hfuzz)

Definition at line 164 of file display.c.

References _HF_DYNFILE_BRANCH_COUNT, _HF_DYNFILE_BTS_EDGE, _HF_DYNFILE_INSTR_COUNT, _HF_DYNFILE_IPT_BLOCK, _HF_DYNFILE_SOFT, _HF_NONMON_SEP, _HF_STATE_DYNAMIC_DRY_RUN, _HF_STATE_DYNAMIC_MAIN, _HF_STATE_DYNAMIC_MINIMIZE, _HF_STATE_STATIC, ATOMIC_GET, hwcnt_t::bbCnt, honggfuzz_t::blCrashesCnt, honggfuzz_t::cfg, honggfuzz_t::cmdline_txt, honggfuzz_t::cnts, honggfuzz_t::covFeedbackMap, hwcnt_t::cpuBranchCnt, hwcnt_t::cpuInstrCnt, honggfuzz_t::crashesCnt, honggfuzz_t::display, display_printKMG(), display_put(), display_start(), display_stop(), honggfuzz_t::dynFileMethod, honggfuzz_t::dynfileqCnt, ESC_BOLD, ESC_CLEAR_ABOVE, ESC_NAV, ESC_NAV_DOWN, ESC_NAV_HORIZ, ESC_RED, ESC_RESET, ESC_SCROLL_REGION, honggfuzz_t::feedback, honggfuzz_t::fileCnt, getCpuUse(), getDuration(), feedback_t::guardNb, hfuzz, honggfuzz_t::hwCnts, honggfuzz_t::io, honggfuzz_t::lastCovUpdate, honggfuzz_t::lastDisplayUSecs, logIsTTY(), logMutexGet(), honggfuzz_t::maxInputSz, honggfuzz_t::mutate, honggfuzz_t::mutationsCnt, honggfuzz_t::mutationsMax, MX_SCOPED_LOCK, PROG_NAME, PROG_VERSION, honggfuzz_t::runEndTime, hwcnt_t::softCntCmp, hwcnt_t::softCntEdge, hwcnt_t::softCntPc, honggfuzz_t::state, honggfuzz_t::switchingToFDM, honggfuzz_t::testedFileCnt, honggfuzz_t::threads, honggfuzz_t::timeoutedCnt, honggfuzz_t::timeStart, honggfuzz_t::timing, honggfuzz_t::tmOut, honggfuzz_t::uniqueCrashesCnt, util_timeNowUSecs(), and honggfuzz_t::verifiedCrashesCnt.

Referenced by mainThreadLoop().

◆ display_fini()

void display_fini ( void  )

Definition at line 318 of file display.c.

References display_imm(), ESC_NAV_DOWN, and ESC_SCROLL_RESET.

Referenced by display_init().

◆ display_imm()

static void display_imm ( const char *  str)
static

Definition at line 72 of file display.c.

References logFd(), and TEMP_FAILURE_RETRY.

Referenced by display_clear(), and display_fini().

◆ display_init()

void display_init ( void  )

Definition at line 327 of file display.c.

References display_clear(), and display_fini().

Referenced by main().

◆ display_printKMG()

static void display_printKMG ( uint64_t  val)
static

Definition at line 76 of file display.c.

References display_put(), and val.

Referenced by display_display().

◆ display_put()

static void display_put ( const char *  fmt,
  ... 
)
static

Definition at line 65 of file display.c.

References displayBuf, and util_vssnprintf().

Referenced by display_display(), and display_printKMG().

◆ display_start()

static void display_start ( void  )
static

Definition at line 57 of file display.c.

References displayBuf.

Referenced by display_display().

◆ display_stop()

static void display_stop ( void  )
static

Definition at line 61 of file display.c.

References displayBuf, logFd(), and TEMP_FAILURE_RETRY.

Referenced by display_display().

◆ getCpuUse()

static unsigned getCpuUse ( int  numCpus)
static

Definition at line 88 of file display.c.

References defer, and LOG_W.

Referenced by display_display().

◆ getDuration()

static void getDuration ( time_t  elapsed_second,
char *  buf,
size_t  bufSz 
)
static

Definition at line 126 of file display.c.

References second.

Referenced by display_display().

Variable Documentation

◆ displayBuf

char displayBuf[1024 *1024]
static

Definition at line 56 of file display.c.

Referenced by display_put(), display_start(), and display_stop().