Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scdaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
scouting-demonstrator
scdaq
Commits
6070a0e4
Commit
6070a0e4
authored
1 year ago
by
Giovanna Lazzari Miotto
Browse files
Options
Downloads
Patches
Plain Diff
DAX on, hardcoded GMT file size
parent
e6dde519
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/FileDmaInputFilter.cc
+9
-3
9 additions, 3 deletions
src/FileDmaInputFilter.cc
with
9 additions
and
3 deletions
src/FileDmaInputFilter.cc
+
9
−
3
View file @
6070a0e4
...
...
@@ -2,13 +2,10 @@
#include
<fcntl.h>
#include
<sys/mman.h>
#include
<sys/stat.h>
#include
<sys/types.h>
#include
<unistd.h>
#include
<cassert>
#include
<cerrno>
#include
<cstdint>
#include
<cstring>
#include
<sstream>
#include
<system_error>
...
...
@@ -83,6 +80,8 @@ static inline ssize_t read_dma_packet_from_file(FILE *inputFile, char *buffer, s
if
(
rc
!=
32
)
{
if
(
feof
(
inputFile
)
&&
rc
==
0
&&
bytesRead
==
0
)
{
// We have reached the perfect end of the file, let's start again
std
::
cout
<<
"Reached EOF, rewinding file! It's been "
<<
std
::
to_string
(
nbReads
)
<<
" read calls."
<<
std
::
endl
;
fseek
(
inputFile
,
0
,
SEEK_SET
);
continue
;
}
...
...
@@ -157,6 +156,12 @@ inline ssize_t FileDmaInputFilter::readPacket(char **buffer, ssize_t bufferSize)
// bufferSize must be multiple of page size
std
::
cout
<<
"Current mmap offset: "
<<
std
::
to_string
(
mmap_offset_
)
<<
" out of "
<<
std
::
to_string
(
DAX_LENGTH
)
<<
std
::
endl
;
if
(
mmap_offset_
>=
9050784
)
{
std
::
cout
<<
"Mmap offset is at EOF, we start over"
<<
std
::
endl
;
mmap_offset_
=
0
;
}
bytesRead
=
read_dma_packet_buffer
(
mmap_buffer_
+
mmap_offset_
,
*
buffer
,
bufferSize
);
mmap_offset_
+=
bytesRead
;
std
::
cout
<<
"Bytes read: "
<<
std
::
to_string
(
bytesRead
)
<<
std
::
endl
;
...
...
@@ -185,6 +190,7 @@ inline ssize_t FileDmaInputFilter::readPacket(char **buffer, ssize_t bufferSize)
#else
bytesRead
=
read_dma_packet_from_file
(
inputFile
,
*
buffer
,
bufferSize
,
nbReads
());
std
::
cout
<<
"Bytes read: "
<<
std
::
to_string
(
bytesRead
)
<<
std
::
endl
;
// If large packet returned, skip and read again
while
(
bytesRead
>
(
ssize_t
)
bufferSize
)
{
...
...
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