forked from ColinIanKing/stress-ng
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core-pragma: move pragma related macros to new header
Move pragma macros from stress-ng.h to core-pragma.h as these macros are only required for just several stressors and it makes cppchecking faster. Signed-off-by: Colin Ian King <[email protected]>
- Loading branch information
1 parent
2628100
commit d7d5cfc
Showing
8 changed files
with
54 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2022 Colin Ian King | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
#ifndef CORE_PRAGMA_H | ||
#define CORE_PRAGMA_H | ||
|
||
#if defined(__clang__) && \ | ||
NEED_CLANG(4, 0, 0) && \ | ||
defined(HAVE_PRAGMA) | ||
#define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push") | ||
#define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop") | ||
#define STRESS_PRAGMA_WARN_OFF _Pragma("GCC diagnostic ignored \"-Weverything\"") | ||
#elif defined(__GNUC__) && \ | ||
defined(HAVE_PRAGMA) && \ | ||
NEED_GNUC(4, 4, 0) | ||
#define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push") | ||
#define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop") | ||
#define STRESS_PRAGMA_WARN_OFF _Pragma("GCC diagnostic ignored \"-Wall\"") \ | ||
_Pragma("GCC diagnostic ignored \"-Wextra\"") \ | ||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ | ||
_Pragma("GCC diagnostic ignored \"-Wcast-qual\"") \ | ||
_Pragma("GCC diagnostic ignored \"-Wnonnull\"") | ||
#else | ||
#define STRESS_PRAGMA_PUSH | ||
#define STRESS_PRAGMA_POP | ||
#define STRESS_PRAGMA_WARN_OFF | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
* Copyright (C) 2013-2021 Canonical, Ltd. | ||
* Copyright (C) 2022 Colin Ian King. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -14,23 +15,16 @@ | |
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* This code is a complete clean re-write of the stress tool by | ||
* Colin Ian King <[email protected]> and attempts to be | ||
* backwardly compatible with the stress tool by Amos Waterland | ||
* <[email protected]> but has more stress tests and more | ||
* functionality. | ||
* | ||
*/ | ||
#include "stress-ng.h" | ||
#include "core-pragma.h" | ||
|
||
static const stress_help_t help[] = { | ||
{ NULL, "rseq N", "start N workers that exercise restartable sequences" }, | ||
{ NULL, "rseq-ops N", "stop after N bogo restartable sequence operations" }, | ||
{ NULL, NULL, NULL } | ||
}; | ||
|
||
|
||
#if defined(HAVE_LINUX_RSEQ_H) && \ | ||
defined(HAVE_ASM_NOP) && \ | ||
defined(__NR_rseq) && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
* Copyright (C) 2013-2021 Canonical, Ltd. | ||
* Copyright (C) 2022 Colin Ian King. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -15,14 +16,9 @@ | |
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* This code is a complete clean re-write of the stress tool by | ||
* Colin Ian King <[email protected]> and attempts to be | ||
* backwardly compatible with the stress tool by Amos Waterland | ||
* <[email protected]> but has more stress tests and more | ||
* functionality. | ||
* | ||
*/ | ||
#include "stress-ng.h" | ||
#include "core-pragma.h" | ||
|
||
static const stress_help_t help[] = { | ||
{ NULL, "utime N", "start N workers updating file timestamps" }, | ||
|