Mirror von
https://github.com/tkuschel/bees.git
synchronisiert 2026-06-19 06:57:54 +02:00
bees: add version string and put it in main() and stats file
Now that we have more than one bees release it's somewhat important to know which one each bug report is for...
Dieser Commit ist enthalten in:
@@ -0,0 +1 @@
|
|||||||
|
bees-version.h
|
||||||
+3
-1
@@ -11,6 +11,8 @@ LIBS = -lcrucible -lpthread
|
|||||||
LDFLAGS = -L../lib -Wl,-rpath=$(shell realpath ../lib)
|
LDFLAGS = -L../lib -Wl,-rpath=$(shell realpath ../lib)
|
||||||
|
|
||||||
depends.mk: Makefile *.cc
|
depends.mk: Makefile *.cc
|
||||||
|
echo "#define BEES_VERSION \"$(shell git describe --always --dirty || echo UNKNOWN)\"" > bees-version.new.h
|
||||||
|
mv -f bees-version.new.h bees-version.h
|
||||||
for x in *.cc; do $(CXX) $(CXXFLAGS) -M "$$x"; done > depends.mk.new
|
for x in *.cc; do $(CXX) $(CXXFLAGS) -M "$$x"; done > depends.mk.new
|
||||||
mv -fv depends.mk.new depends.mk
|
mv -fv depends.mk.new depends.mk
|
||||||
|
|
||||||
@@ -36,4 +38,4 @@ BEES_OBJS = \
|
|||||||
$(CXX) $(CXXFLAGS) -o "$@" $(BEES_OBJS) $(LDFLAGS) $(LIBS)
|
$(CXX) $(CXXFLAGS) -o "$@" $(BEES_OBJS) $(LDFLAGS) $(LIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -fv *.o
|
-rm -fv *.o bees-version.h
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "bees-version.h"
|
||||||
#include "bees.h"
|
#include "bees.h"
|
||||||
|
|
||||||
#include "crucible/crc64.h"
|
#include "crucible/crc64.h"
|
||||||
@@ -259,6 +260,7 @@ BeesHashTable::prefetch_loop()
|
|||||||
|
|
||||||
graph_blob << "Now: " << format_time(time(NULL)) << "\n";
|
graph_blob << "Now: " << format_time(time(NULL)) << "\n";
|
||||||
graph_blob << "Uptime: " << m_ctx->total_timer().age() << " seconds\n";
|
graph_blob << "Uptime: " << m_ctx->total_timer().age() << " seconds\n";
|
||||||
|
graph_blob << "Version: " << BEES_VERSION << "\n";
|
||||||
|
|
||||||
graph_blob
|
graph_blob
|
||||||
<< "\nHash table page occupancy histogram (" << occupied_count << "/" << total_count << " cells occupied, " << (occupied_count * 100 / total_count) << "%)\n"
|
<< "\nHash table page occupancy histogram (" << occupied_count << "/" << total_count << " cells occupied, " << (occupied_count * 100 / total_count) << "%)\n"
|
||||||
|
|||||||
+4
-1
@@ -1,3 +1,4 @@
|
|||||||
|
#include "bees-version.h"
|
||||||
#include "bees.h"
|
#include "bees.h"
|
||||||
|
|
||||||
#include "crucible/interp.h"
|
#include "crucible/interp.h"
|
||||||
@@ -557,7 +558,7 @@ bees_main(ArgList args)
|
|||||||
list<shared_ptr<BeesContext>> all_contexts;
|
list<shared_ptr<BeesContext>> all_contexts;
|
||||||
shared_ptr<BeesContext> bc;
|
shared_ptr<BeesContext> bc;
|
||||||
|
|
||||||
// Subscribe to fanotify events
|
// Create a context and start crawlers
|
||||||
bool did_subscription = false;
|
bool did_subscription = false;
|
||||||
for (string arg : args) {
|
for (string arg : args) {
|
||||||
catch_all([&]() {
|
catch_all([&]() {
|
||||||
@@ -585,6 +586,8 @@ bees_main(ArgList args)
|
|||||||
int
|
int
|
||||||
main(int argc, const char **argv)
|
main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
cerr << "bees version " << BEES_VERSION << endl;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
do_cmd_help(argv);
|
do_cmd_help(argv);
|
||||||
return 2;
|
return 2;
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren