Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
6292-erts-Fix-EventStateFlag-printing-ERTS_EV_F...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 6292-erts-Fix-EventStateFlag-printing-ERTS_EV_FLAG_WANT_E.patch of Package erlang
From 8ce09b330d018786fd9085ec209afc1f6351b5f4 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Fri, 4 Mar 2022 20:05:34 +0100 Subject: [PATCH 2/4] erts: Fix EventStateFlag printing ERTS_EV_FLAG_WANT_ERROR --- erts/emulator/sys/common/erl_check_io.c | 37 +++++++++++++++++-------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/erts/emulator/sys/common/erl_check_io.c b/erts/emulator/sys/common/erl_check_io.c index 3022ff1598..bf18502887 100644 --- a/erts/emulator/sys/common/erl_check_io.c +++ b/erts/emulator/sys/common/erl_check_io.c @@ -93,7 +93,7 @@ typedef enum { #endif ERTS_EV_FLAG_WANT_ERROR = 0x10, /* ERL_NIF_SELECT_ERROR turned on */ - /* Combinations */ + /* Combinations, defined only to be displayed by debugger (gdb) */ ERTS_EV_FLAG_USED_FALLBACK = ERTS_EV_FLAG_USED | ERTS_EV_FLAG_FALLBACK, ERTS_EV_FLAG_USED_SCHEDULER = ERTS_EV_FLAG_USED | ERTS_EV_FLAG_SCHEDULER, ERTS_EV_FLAG_USED_IN_SCHEDULER = ERTS_EV_FLAG_USED | ERTS_EV_FLAG_SCHEDULER | ERTS_EV_FLAG_IN_SCHEDULER, @@ -101,16 +101,25 @@ typedef enum { ERTS_EV_FLAG_UNUSED_IN_SCHEDULER = ERTS_EV_FLAG_SCHEDULER | ERTS_EV_FLAG_IN_SCHEDULER } EventStateFlags; -#define flag2str(flags) \ - ((flags) == ERTS_EV_FLAG_CLEAR ? "CLEAR" : \ - ((flags) == ERTS_EV_FLAG_USED ? "USED" : \ - ((flags) == ERTS_EV_FLAG_FALLBACK ? "FLBK" : \ - ((flags) == ERTS_EV_FLAG_USED_FALLBACK ? "USED|FLBK" : \ - ((flags) == ERTS_EV_FLAG_USED_SCHEDULER ? "USED|SCHD" : \ - ((flags) == ERTS_EV_FLAG_UNUSED_SCHEDULER ? "SCHD" : \ - ((flags) == ERTS_EV_FLAG_USED_IN_SCHEDULER ? "USED|IN_SCHD" : \ - ((flags) == ERTS_EV_FLAG_UNUSED_IN_SCHEDULER ? "IN_SCHD" : \ - "ERROR")))))))) + +static const char* event_state_flag_to_str(EventStateFlags f) +{ + switch ((int)f) { + case ERTS_EV_FLAG_CLEAR: return "CLEAR"; + case ERTS_EV_FLAG_USED: return "USED"; + case ERTS_EV_FLAG_FALLBACK: return "FLBK"; + case ERTS_EV_FLAG_FALLBACK | ERTS_EV_FLAG_USED: return "USED|FLBK"; + +#if ERTS_POLL_USE_SCHEDULER_POLLING + case ERTS_EV_FLAG_SCHEDULER: return "SCHD"; + case ERTS_EV_FLAG_SCHEDULER | ERTS_EV_FLAG_USED: return "USED|SCHD"; + case ERTS_EV_FLAG_SCHEDULER | ERTS_EV_FLAG_IN_SCHEDULER: return "IN_SCHD"; + case ERTS_EV_FLAG_SCHEDULER | ERTS_EV_FLAG_IN_SCHEDULER + | ERTS_EV_FLAG_USED: return "USED|IN_SCHD"; +#endif + default: return "ERROR"; + } +} /* How many events that can be handled at once by one erts_poll_wait call */ #define ERTS_CHECK_IO_POLL_RES_LEN 512 @@ -2534,7 +2543,11 @@ print_events(erts_dsprintf_buf_t *dsbufp, ErtsPollEvents ev) static ERTS_INLINE void print_flags(erts_dsprintf_buf_t *dsbufp, EventStateFlags f) { - erts_dsprintf(dsbufp, "%s", flag2str(f)); + if (f & ERTS_EV_FLAG_WANT_ERROR) { + erts_dsprintf(dsbufp, "WANTERR|"); + f &= ~ERTS_EV_FLAG_WANT_ERROR; + } + erts_dsprintf(dsbufp, "%s", event_state_flag_to_str(f)); } #ifdef DEBUG_PRINT_MODE -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor