Skip to content

Commit

Permalink
recorder: Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Aug 17, 2022
1 parent 5dad87e commit 94b3d94
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyxcp/recorder/build_clang.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
clang++ -std=c++20 -O3 -fvectorize -Rpass=loop-vectorize -ggdb -Wall -Wextra -Weffc++ -DLZ4_DEBUG=1 -DSTANDALONE_REKORDER=1 lz4.cpp rekorder.cpp -o rekorder
clang++ -std=c++20 -O3 -fvectorize -Rpass=loop-vectorize -ggdb -Wall -Wextra -Weffc++-lpthread -DLZ4_DEBUG=1 -DSTANDALONE_REKORDER=1 lz4.cpp rekorder.cpp -o rekorder
4 changes: 2 additions & 2 deletions pyxcp/recorder/build_gcc.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
g++ -std=c++20 -O3 -ffast-math -ftree-vectorize -ftree-vectorizer-verbose=9 -fcoroutines -ggdb -Wall -Wextra -Weffc++ -DLZ4_DEBUG=1 -DSTANDALONE_REKORDER=1 lz4.cpp rekorder.cpp -o rekorder
#!/bin/sh
g++ -std=c++20 -O3 -ffast-math -ftree-vectorize -ftree-vectorizer-verbose=9 -fcoroutines -ggdb -Wall -Wextra -Weffc++ -DLZ4_DEBUG=1 -DSTANDALONE_REKORDER=1 lz4.cpp rekorder.cpp -o rekorder -lpthread
Empty file modified pyxcp/recorder/build_gcc_arm.sh
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions pyxcp/recorder/rekorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void some_records(XcpLogFileWriter& writer)
fr.timestamp = std::clock();
fr.length = 10 + (rand() % 240);
filler = (filler + 1) % 16;
printf("buffer: %p\n", buffer);
memset(buffer, filler, fr.length);
writer.add_frame(fr.category, fr.counter, fr.timestamp, fr.length, reinterpret_cast<char*>(&buffer));
}
Expand Down
7 changes: 4 additions & 3 deletions pyxcp/recorder/rekorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct frame_header_t
using FrameTuple = std::tuple<std::uint8_t, std::uint16_t, double, std::uint16_t, payload_t>;
using FrameVector = std::vector<FrameTuple>;

using FrameTupleWriter = std::tuple<std::uint8_t, std::uint16_t, double, std::uint16_t, std::shared_ptr<blob_t[]>>;
using FrameTupleWriter = std::tuple<std::uint8_t, std::uint16_t, double, std::uint16_t, std::shared_ptr<char[]>>;


enum class FrameCategory : std::uint8_t {
Expand Down Expand Up @@ -325,8 +325,9 @@ class XcpLogFileWriter
}

void add_frame(uint8_t category, uint16_t counter, double timestamp, uint16_t length, char const * data) {
auto pl = std::make_shared<blob_t[]>(length);
_fcopy(reinterpret_cast<char*>(pl.get()), data, length);
auto pl = std::make_shared<char []>(length);
printf("data: %p length: %u\n", data, length);
_fcopy(pl.get(), data, length);

my_queue.put(
std::make_tuple(category, counter, timestamp, length, std::move(pl))
Expand Down

0 comments on commit 94b3d94

Please sign in to comment.