Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
pub
frama-c
Commits
59083458
Commit
59083458
authored
1 year ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[doc] more dune keywords + use logs in some places
parent
3535da89
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/developer/advance.tex
+13
-13
13 additions, 13 deletions
doc/developer/advance.tex
doc/frama-c-book.cls
+13
-11
13 additions, 11 deletions
doc/frama-c-book.cls
with
26 additions
and
24 deletions
doc/developer/advance.tex
+
13
−
13
View file @
59083458
...
...
@@ -4209,9 +4209,9 @@ For quick usage of the library:
\item
install the instrumented
\framac
:
\texttt
{
make install DUNE
\_
WS=bench
}
.
\item
enable instrumentation
{
\em
during execution
}
of
\framac
, using the
\texttt
{
OCAML
\_
LANDMARKS
}
environment variable:
\begin{l
stlisting
}
\begin{l
ogs
}
OCAML
_
LANDMARKS=<options> frama-c [files] [options]
\end{l
stlisting
}
\end{l
ogs
}
The easiest setup is
\texttt
{
OCAML
\_
LANDMARKS=auto
}
, which will instrument
everything and output timing information to
\texttt
{
stderr
}
after
program termination.
...
...
@@ -4219,10 +4219,10 @@ OCAML_LANDMARKS=<options> frama-c [files] [options]
output the timing information to file
\texttt
{
landmarks.log
}
.
\item
you can also run the instrumented
\framac
without installing it, via
\texttt
{
dune exec
}
:
\begin{
shell
}
\begin{
logs
}
OCAML
_
LANDMARKS=auto dune exec --workspace dev/dune-workspace.bench
\
--context bench -- frama-c [files] [options]
\end{
shell
}
\end{
logs
}
The
\verb
+
--workspace dev/dune-workspace.bench
+
argument tells Dune to use
the workspace in which Landmarks is configured.
...
...
@@ -4238,9 +4238,9 @@ of the file.
To instrument a single function: add
\verb
+
[@landmark]
+
after the
\texttt
{
let
}
,
e.g.:
\begin{
lstlisting
}
\begin{
ocamlcode
}
let[@landmark] add
_
visitor vis =
\end{
lstlisting
}
\end{
ocamlcode
}
Check
\url
{
https://github.com/LexiFi/landmarks
}
for its documentation.
...
...
@@ -4257,7 +4257,7 @@ To profile your own plug-in using Landmarks, do the following:
(public
_
name frama-c-my-plug-in.core)
...
(libraries frama-c.kernel)
(instrumentation (backend landmarks)) ;<<< ADD THIS LINE
(instrumentation (backend landmarks)) ;
<<< ADD THIS LINE
)
\end{dunecode}
\item
Create a
\verb
|
dune-workspace.bench
|
file in your plugin's top-level
...
...
@@ -4266,21 +4266,21 @@ To profile your own plug-in using Landmarks, do the following:
\duneinput
{
dune-workspace.bench
}
\item
Add
\verb
|
--workspace=dune-workspace.bench
|
to the
\verb
|
dune build
|
and
\verb
|
dune install
|
commands that you run, e.g.:
\begin{l
stlisting
}
\begin{l
ogs
}
dune build --workspace=dune-workspace.bench @install
dune install --workspace=dune-workspace.bench
\end{l
stlisting
}
\end{l
ogs
}
This will compile and install the plug-in with Landmarks instrumentation
enabled. Then you just need to set
\verb
|
OCAML_LANDMARKS
|
as described in the
previous section, e.g.:
\begin{l
stlisting
}
\begin{l
ogs
}
OCAML
_
LANDMARKS=auto frama-c [my-plugin-options]
\end{l
stlisting
}
\end{l
ogs
}
\item
For
\verb
|
dune exec
|
, you need to add the
\verb
|
--workspace
|
option
as well as
\verb
|
--context bench
|
. Combined with
\verb
|
OCAML_LANDMARKS
|
,
the command-line will resemble the following:
\begin{l
stlisting
}
\begin{l
ogs
}
OCAML
_
LANDMARKS=auto dune exec --workspace dev/dune-workspace.bench
\
--context bench -- frama-c [files] [options]
\end{l
stlisting
}
\end{l
ogs
}
\end{enumerate}
This diff is collapsed.
Click to expand it.
doc/frama-c-book.cls
+
13
−
11
View file @
59083458
...
...
@@ -432,6 +432,7 @@
\definecolor
{
lstmodule
}{
rgb
}{
0.3,0.6,0.2
}
\definecolor
{
lstspecial
}{
rgb
}{
0.2,0.6,0.0
}
\definecolor
{
lstfile
}{
gray
}{
0.85
}
\definecolor
{
lstcomments
}{
rgb
}{
0.35,0.35,0.35
}
\newcommand
{
\lstbrk
}{
\mbox
{$
\color
{
blue
}
\scriptstyle\cdots
$}}
...
...
@@ -439,7 +440,7 @@
\def\lp
@inline
{
\ifmmode\normalfont\mathtt\scriptstyle\else\normalfont\ttfamily\mdseries\normalsize\fi
}
\def\lp
@keyword
{}
\def\lp
@special
{
\color
{
frama-c-dark-orange
}}
\def\lp
@comment
{
\normalfont\ttfamily\mdseries
}
\def\lp
@comment
{
\normalfont\ttfamily\mdseries
\color
{
lstcomments
}
}
\def\lp
@string
{
\color
{
frama-c-dark-green
}}
\def\lp
@ident
{}
\def\lp
@number
{
\rmfamily\tiny\color
{
lstnum
}
\noncopynumber
}
...
...
@@ -614,17 +615,18 @@
{
é
}{{
\'
e
}}
1
%
,
style=frama-c-style,
%
morekeywords=
{
action, alias, as, deps, dune, executable, files, flags, from,
generate
_
opam
_
files, install, lang, libraries, library, name, optional,
package, plugin, progn, public
_
name, rule, section, select, site,
targets, using
alsoletter=:-,
%
keywords=
{
%
action,alias,as,backend,context,default,deps,dune,executable,
%
env,env-vars,files,flags,from,generate
_
opam
_
files,install,
%
instrument
_
with,instrumentation,lang,libraries,library,name,optional,
%
package,plugin,profile,progn,public
_
name,rule,section,select,site,
%
targets,using
%
}
,
%
alsoletter=:,
morekeywords=[2]
{
:standard
}
,
morecomment=[l]
{
;
}
,
morekeywords=[2]
{
%
:standard
%
}
,
%
morecomment=[l]
{
;
}
,
%
}
\lstdefinestyle
{
dune-basic
}{
%
...
...
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