avner-levy / iotrace Goto Github PK
View Code? Open in Web Editor NEWMonitor Linux processes files IO
License: Apache License 2.0
Monitor Linux processes files IO
License: Apache License 2.0
openat doesn't always provide the full path so multiple files with the same name can be reported as one file.
dup2 may be used to duplicate file descriptors.
Since iotrace doesn't monitor this API it won't be familiar with the duplicated file descriptor details.
Since both strace and the command we pass to strace to run, use the same stdout, stderr files their output may mix together and iotrace won't be able to read file operations data.
We need to find a way to redirect the internal command or strace output to different pipes / file descriptors.
main.cpp
#include "CIoTrace.h"
----------------^
terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
probably while access denied to proc
Fatal: Failed to stat file /proc/xxxx/fd/yyyy
and
Fatal: Trying to add file while file num already open
Make fails with this output:
c++ -pedantic-errors -Wall -Wextra -Werror -Iinclude/ -o build/objects/src/CIOTrace.o -c src/CIOTrace.cpp
In file included from include/CIOTrace.h:14,
from src/CIOTrace.cpp:12:
include/CStraceOutputParser.h: In member function ‘virtual void CStraceOutputParser::CStraceOpenOperation::setFilename(const std::string&)’:
include/CStraceOutputParser.h:72:93: error: ignoring return value of ‘bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]’, declared with attribute ‘nodiscard’ [-Werror=unused-result]
72 | virtual void setFilename(const std::string &a_sFilename) {m_sFilename==a_sFilename;}
| ~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/13.2.1/string:54,
from src/CIOTrace.cpp:8:
/usr/include/c++/13.2.1/bits/basic_string.h:3698:5: note: declared here
3698 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
cc1plus: all warnings being treated as errors
make: [Makefile:21: build/objects/src/CIOTrace.o] Error 1 (ignored)
c++ -pedantic-errors -Wall -Wextra -Werror -Iinclude/ -o build/objects/src/CStraceOutputParser.o -c src/CStraceOutputParser.cpp
In file included from src/CStraceOutputParser.cpp:10:
include/CStraceOutputParser.h: In member function ‘virtual void CStraceOutputParser::CStraceOpenOperation::setFilename(const std::string&)’:
include/CStraceOutputParser.h:72:93: error: ignoring return value of ‘bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]’, declared with attribute ‘nodiscard’ [-Werror=unused-result]
72 | virtual void setFilename(const std::string &a_sFilename) {m_sFilename==a_sFilename;}
| ~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/13.2.1/string:54,
from /usr/include/c++/13.2.1/bits/locale_classes.h:40,
from /usr/include/c++/13.2.1/bits/ios_base.h:41,
from /usr/include/c++/13.2.1/ios:44,
from /usr/include/c++/13.2.1/ostream:40,
from /usr/include/c++/13.2.1/iostream:41,
from src/CStraceOutputParser.cpp:8:
/usr/include/c++/13.2.1/bits/basic_string.h:3698:5: note: declared here
3698 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
cc1plus: all warnings being treated as errors
make: [Makefile:21: build/objects/src/CStraceOutputParser.o] Error 1 (ignored)
c++ -pedantic-errors -Wall -Wextra -Werror -Iinclude/ -o build/objects/src/main.o -c src/main.cpp
In file included from include/CIOTrace.h:14,
from src/main.cpp:12:
include/CStraceOutputParser.h: In member function ‘virtual void CStraceOutputParser::CStraceOpenOperation::setFilename(const std::string&)’:
include/CStraceOutputParser.h:72:93: error: ignoring return value of ‘bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]’, declared with attribute ‘nodiscard’ [-Werror=unused-result]
72 | virtual void setFilename(const std::string &a_sFilename) {m_sFilename==a_sFilename;}
| ~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/13.2.1/string:54,
from /usr/include/c++/13.2.1/bits/locale_classes.h:40,
from /usr/include/c++/13.2.1/bits/ios_base.h:41,
from /usr/include/c++/13.2.1/ios:44,
from /usr/include/c++/13.2.1/ostream:40,
from /usr/include/c++/13.2.1/iostream:41,
from src/main.cpp:7:
/usr/include/c++/13.2.1/bits/basic_string.h:3698:5: note: declared here
3698 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
cc1plus: all warnings being treated as errors
make: [Makefile:21: build/objects/src/main.o] Error 1 (ignored)
c++ -pedantic-errors -Wall -Wextra -Werror -Iinclude/ -L/usr/lib -lstdc++ -lm -o ./build/apps/iotrace ./build/objects/src/CActiveFileId.o ./build/objects/src/CActiveFileInfo.o ./build/objects/src/CGetProcessInfo.o ./build/objects/src/CIOTrace.o ./build/objects/src/COutput.o ./build/objects/src/CPendingIoOp.o ./build/objects/src/CStraceOutputParser.o ./build/objects/src/main.o
/usr/bin/ld: cannot find ./build/objects/src/CIOTrace.o: No such file or directory
/usr/bin/ld: cannot find ./build/objects/src/CStraceOutputParser.o: No such file or directory
/usr/bin/ld: cannot find ./build/objects/src/main.o: No such file or directory
collect2: error: ld returned 1 exit status
make: [Makefile:25: build/apps/iotrace] Error 1 (ignored)
from a freshly cloned repo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.