Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error when unthreded execution and tracing are both enabl… #182

Closed
wants to merge 1 commit into from

Conversation

ChadliaJerad
Copy link
Collaborator

This PR fixes the compile error due to tracing in an unthreaded execution.
Currently, the .lft file is generated, but w/o contents.
Writing to the trace file is WIP.

…ed. Currently, the lft file is generated, but w/o contents. This is still work in progress.
@ChadliaJerad
Copy link
Collaborator Author

Oops, the PR breaks Arduino, Zephy... tests...
At the same time, replacing:

typedef void* lf_mutex_t;
typedef void* lf_cond_t;
typedef void* lf_thread_t;

with:

typedef void lf_mutex_t;
typedef void lf_cond_t;
typedef void lf_thread_t;

unfixes the compilation of test/C/src/CountTest.lf, when threading is set to false...

Any hint on the usefulness of _LF_TRACE?

@ChadliaJerad
Copy link
Collaborator Author

The failing tests seem related to this PR though.

Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not feel like the right solution to me. Ideally, platform.h would not need to know anything at all about tracing. That file shouldn't mention tracing.

One possible way to solve the problem that the trace file does not get written is that instead of just ignoring the call to create a thread, the unthreaded runtime could execute the function passed in the current thread.

@erlingrj
Copy link
Collaborator

Maybe the easiest would be to start by disabling tracing for uthreaded runtime, then we need to figure out how to adapt trace.c to either:
A) Not use the threaded API but use some other abstraction (e.g. enter/exit critical section)
B) Conditionally include code with the preprocessor based on THREADED/UNTHREADED

@ChadliaJerad
Copy link
Collaborator Author

Closed as solved in #178.

@ChadliaJerad ChadliaJerad deleted the fix-unthreaded-tracing branch March 22, 2023 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants