Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
2c0576c5
Commit
2c0576c5
authored
6 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
support stop/dump before/after
Former-commit-id: 3d0a4546340821dae1baa049ac6426b8ec60face
parent
2db0511a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libIRDB/src/core/fileir.cpp
+2
-0
2 additions, 0 deletions
libIRDB/src/core/fileir.cpp
tools/thanos/thanos.cpp
+25
-6
25 additions, 6 deletions
tools/thanos/thanos.cpp
with
27 additions
and
6 deletions
libIRDB/src/core/fileir.cpp
+
2
−
0
View file @
2c0576c5
...
...
@@ -1328,12 +1328,14 @@ void FileIR_t::GarbageCollectICFS()
}
}
/*
int unused_icfs = this->GetAllICFS().size() - used_icfs.size();
if (unused_icfs > 0)
{
cerr << "FileIR_t::GarbageCollectICFS(): WARNING: " << dec << unused_icfs << " unused ICFS found. ";
cerr << "Deleting before committing to IRDB" << endl;
}
*/
ICFSSet_t
to_erase
;
for
(
ICFSSet_t
::
const_iterator
it
=
this
->
GetAllICFS
().
begin
();
...
...
This diff is collapsed.
Click to expand it.
tools/thanos/thanos.cpp
+
25
−
6
View file @
2c0576c5
...
...
@@ -22,6 +22,7 @@ ofstream thanos_log;
ostream
*
real_cout
;
ostream
*
real_cerr
;
string
thanos_path
;
bool
redirect_opt
=
true
;
class
ThanosPlugin_t
{
...
...
@@ -65,8 +66,6 @@ const unique_ptr<IRDBObjects_t> ThanosPlugin_t::shared_objects(new IRDBObjects_t
using
PluginList_t
=
vector
<
unique_ptr
<
ThanosPlugin_t
>>
;
PluginList_t
getPlugins
(
const
int
argc
,
char
const
*
const
argv
[]);
int
main
(
int
argc
,
char
*
argv
[])
{
thanos_path
=
argv
[
0
];
...
...
@@ -83,14 +82,31 @@ int main(int argc, char* argv[])
exit
(
1
);
}
// get plugins
auto
thanos_plugins
=
getPlugins
(
argc
-
1
,
argv
+
1
);
auto
argv_iter
=
1
;
while
(
true
)
{
if
(
argv_iter
>=
argc
)
{
break
;
}
if
(
string
(
argv
[
argv_iter
])
==
"--no-redirect"
)
{
redirect_opt
=
false
;
argv_iter
++
;
}
else
break
;
}
const
auto
plugin_argv_iter
=
argv_iter
;
auto
thanos_plugins
=
getPlugins
(
argc
-
plugin_argv_iter
,
argv
+
plugin_argv_iter
);
if
(
thanos_plugins
.
size
()
==
0
)
{
// for now, usage is pretty strict to enable simple
// parsing, because this program is only used by an
// automated script
thanos_log
<<
"Syntax error in arguments."
<<
endl
;
thanos_log
<<
"USAGE: (
\"
<step name> [-optional] [--step-args [ARGS]]
\"
)+"
<<
endl
;
thanos_log
<<
"USAGE:
<thanos opts>
(
\"
<step name> [-optional] [--step-args [ARGS]]
\"
)+"
<<
endl
;
return
1
;
}
...
...
@@ -234,8 +250,11 @@ int ThanosPlugin_t::runPlugin()
*
real_cout
<<
"Cannot open log file "
<<
logfile_path
<<
endl
;
exit
(
1
);
}
cout
.
rdbuf
(
logfile
.
rdbuf
());
cerr
.
rdbuf
(
logfile
.
rdbuf
());
if
(
redirect_opt
)
{
cout
.
rdbuf
(
logfile
.
rdbuf
());
cerr
.
rdbuf
(
logfile
.
rdbuf
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment