[GSoC 2017] Instrumentation of Rust applications

Saurav Sachidanand <[email protected]> Fri, 3 Mar 2017 14:05:16 +0530
Newsgroups gmane.comp.sysutils.pcp
Message-ID <CACKq+iXnR9hGs00-DNR0BCS92J2FS7tENNjSYd1xnwN6CjJJLA@mail.gmail.com>
--f403045cf5f4de24f60549cf6cd4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello
=E2=80=8B PCP developers=E2=80=8B
,

I'm
=E2=80=8B Saurav Sachidanand, and I'm=E2=80=8B
a CS sophomore studying in India
=E2=80=8B.

=E2=80=8BF=E2=80=8B
or more than year
=E2=80=8B I
've been programming in Rust
=E2=80=8B
=E2=80=8Band have published
 some personal projects in it (
=E2=80=8Bfew =E2=80=8B
involving the Rust-C FFI) and
=E2=80=8Bhave contributed a
 few patches to Servo (github.com/saurvs).
=E2=80=8BThis year, =E2=80=8B
I'm
=E2=80=8Breally
 interested
=E2=80=8B=E2=80=8B
in
=E2=80=8B the GSoC project for=E2=80=8B
implementing a
=E2=80=8Bnative =E2=80=8B
Rust
=E2=80=8Blibrary
 that enables
=E2=80=8B=E2=80=8B
instrumentation
=E2=80=8B
through PCP.
=E2=80=8B =E2=80=8B
I've
=E2=80=8Bbegun exploring

=E2=80=8Bthe =E2=80=8B
PCP
=E2=80=8B tools=E2=80=8B
=E2=80=8Bon Fedora and have started reading up on the developer documentati=
on. I've
also

=E2=80=8Bcloned the
 Speed
=E2=80=8B repository and tried out the examples=E2=80=8B
.
=E2=80=8B

After reading the project description and skimming through the Speed source
code, I'm assuming the following are the deliverable
=E2=80=8Bs=E2=80=8B
involved with the project
- native Rust library to write out metrics as memory mapped values
-  =E2=80=8Bnative Rust library, and command line utility, to dump metrics =
from
memory mapped values
- a high-level Rust API to easily expose metrics from an application,
following the pattern established in Speed (Client, Registry, Metric,
Counter, Gauge etc.)
=E2=80=8B- continuous integration through Travis CI, code coverage through =
Codecov
(coveralls doesn't support Rust)=E2=80=8B
- documentation using rustdoc and host on Github Pages
=E2=80=8B- as a separate library, Rust bindings to libpcp_trace=E2=80=8B
- publish to crates.io=E2=80=8B
-
=E2=80=8B create Rust examples showing usage of the API, and also =E2=80=8B
embedded this instrumentation capability to popular framework
=E2=80=8Bs=E2=80=8B
like hyper <https://github.com/hyperium/hyper>
=E2=80=8B and iron=E2=80=8B <https://github.com/iron/iron>
=E2=80=8B- as a stretch =E2=80=8Bgoal, implement a PCP agent in Rust to exp=
ort metrics
directly, similar to parfait-agent

A major challenge in this project would be that in Rust there is no
universally safe way to deal with memory mapped files, as there are very
few, if any at all, compile-time guarantees the Rust compiler can make
about reads and writes to an mmapped file. Hence, there's no support for it
in the standard library. We'll have to write our own little module around
libc::mmap to get only the functionality we need, or use a third party
crate like memmap-rs <https://github.com/danburkert/memmap-rs> or rust-mmap
<https://github.com/rbranson/rust-mmap>.

=E2=80=8BDoes this outline look good enough to begin writing a proposal?=E2=
=80=8B

Thanks,
Saurav

--f403045cf5f4de24f60549cf6cd4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif">Hello<div style=3D"display:inline">=E2=80=8B PCP develo=
pers=E2=80=8B</div>,<br></div><div class=3D"gmail_quote"><div dir=3D"ltr"><=
div dir=3D"auto"><div style=3D"font-family:arial,helvetica,sans-serif" dir=
=3D"auto"><br></div><div dir=3D"auto"><font face=3D"arial, helvetica, sans=
-serif">I&#39;m</font><div style=3D"font-family:arial,helvetica,sans-serif;=
display:inline">=E2=80=8B Saurav Sachidanand, and I&#39;m=E2=80=8B</div><fo=
nt face=3D"arial, helvetica, sans-serif"> a CS sophomore studying in India<=
/font><div style=3D"font-family:arial,helvetica,sans-serif;display:inline">=
=
=E2=80=8B.</div><font face=3D"arial, helvetica, sans-serif">=C2=A0</font><=
div style=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=
=8BF=E2=80=8B</div><font face=3D"arial, helvetica, sans-serif">or more tha=
n year</font><div style=3D"font-family:arial,helvetica,sans-serif;display:i=
nline">=E2=80=8B I</div><span style=3D"font-family:arial,helvetica,sans-ser=
if">&#39;ve been programming in Rust</span><div style=3D"font-family:arial,=
helvetica,sans-serif;display:inline">=E2=80=8B</div><span style=3D"font-fam=
ily:arial,helvetica,sans-serif"> <div style=3D"font-family:arial,helvetica,=
sans-serif;display:inline">=E2=80=8Band have published</div>=C2=A0some pers=
onal projects in it (<div style=3D"font-family:arial,helvetica,sans-serif;d=
isplay:inline">=E2=80=8Bfew =E2=80=8B</div>involving the Rust-C FFI) and <d=
iv style=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=
=8Bhave contributed a</div>=C2=A0few patches to Servo (</span><a href=3D"h=
ttp://github.com/saurvs" style=3D"font-family:arial,helvetica,sans-serif;te=
xt-decoration:none;color:rgb(66,133,244)" target=3D"_blank">github.com/saur=
vs</a><span style=3D"font-family:arial,helvetica,sans-serif">). <div style=
=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=8BThis y=
ear, =E2=80=8B</div>I&#39;m </span><div style=3D"font-family:arial,helvetic=
a,sans-serif;display:inline">=E2=80=8Breally</div><span style=3D"font-famil=
y:arial,helvetica,sans-serif">=C2=A0interested</span><div style=3D"font-fam=
ily:arial,helvetica,sans-serif;display:inline">=E2=80=8B=E2=80=8B</div><spa=
n style=3D"font-family:arial,helvetica,sans-serif"> in</span><div style=3D"=
font-family:arial,helvetica,sans-serif;display:inline">=E2=80=8B the GSoC p=
roject for=E2=80=8B</div><span style=3D"font-family:arial,helvetica,sans-se=
rif"> implementing a </span><div style=3D"font-family:arial,helvetica,sans-=
serif;display:inline">=E2=80=8Bnative =E2=80=8B</div><span style=3D"font-fa=
mily:arial,helvetica,sans-serif">Rust </span><div style=3D"font-family:aria=
l,helvetica,sans-serif;display:inline">=E2=80=8Blibrary</div><font face=3D"=
arial, helvetica, sans-serif">=C2=A0that enables </font><div style=3D"font-=
family:arial,helvetica,sans-serif;display:inline">=E2=80=8B=E2=80=8B</div><=
font face=3D"arial, helvetica, sans-serif">instrumentation</font><div style=
=
=3D"display:inline"><font face=3D"arial, helvetica, sans-serif">=E2=80=8B<=
/font></div><font face=3D"arial, helvetica, sans-serif"> through PCP.<div s=
tyle=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=8B =
=E2=80=8B</div></font><span style=3D"font-family:arial,helvetica,sans-seri=
f">I&#39;ve </span><div style=3D"font-family:arial,helvetica,sans-serif;dis=
play:inline">=E2=80=8Bbegun exploring</div><span style=3D"font-family:arial=
,helvetica,sans-serif">=C2=A0</span><div style=3D"font-family:arial,helveti=
ca,sans-serif;display:inline">=E2=80=8Bthe =E2=80=8B</div><span style=3D"fo=
nt-family:arial,helvetica,sans-serif">PCP</span><div style=3D"font-family:a=
rial,helvetica,sans-serif;display:inline">=E2=80=8B tools=E2=80=8B</div><sp=
an style=3D"font-family:arial,helvetica,sans-serif"> </span><div style=3D"f=
ont-family:arial,helvetica,sans-serif;display:inline">=E2=80=8Bon Fedora an=
d have started reading up on the developer documentation. I&#39;ve also</di=
v><span style=3D"font-family:arial,helvetica,sans-serif">=C2=A0</span><div =
style=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=8Bcl=
oned the</div><span style=3D"font-family:arial,helvetica,sans-serif">=C2=A0=
Speed</span><div style=3D"font-family:arial,helvetica,sans-serif;display:in=
line">=E2=80=8B repository and tried out the examples=E2=80=8B</div><span s=
tyle=3D"font-family:arial,helvetica,sans-serif">.</span><div style=3D"font-=
family:arial,helvetica,sans-serif;display:inline">=E2=80=8B</div></div><div=
 style=3D"font-family:arial,helvetica,sans-serif" dir=3D"auto"><div style=
=3D"font-family:arial,helvetica,sans-serif;display:inline"><br></div></div=
><div style=3D"font-family:arial,helvetica,sans-serif" dir=3D"auto"><div st=
yle=3D"font-family:arial,helvetica,sans-serif;display:inline">After reading=
 the project description and skimming through the Speed source code, I&#39;=
m assuming the following are the deliverable<div class=3D"gmail_default" st=
yle=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=8Bs=E2=
=
=80=8B</div> involved with the project</div></div><div style=3D"font-famil=
y:arial,helvetica,sans-serif" dir=3D"auto"><div style=3D"font-family:arial,=
helvetica,sans-serif">- native Rust library to write out metrics as memory =
mapped values</div><div style=3D"font-family:arial,helvetica,sans-serif">- =
=
=C2=A0=E2=80=8Bnative Rust library, and command line utility, to dump metr=
ics from memory mapped values</div><div style=3D"font-family:arial,helvetic=
a,sans-serif">- a high-level Rust API to easily expose metrics from an appl=
ication, following the pattern established in Speed (Client, Registry, Metr=
ic, Counter, Gauge etc.)</div><div style=3D"font-family:arial,helvetica,san=
s-serif">=E2=80=8B- continuous integration through Travis CI, code coverage=
 through Codecov (coveralls doesn&#39;t support Rust)=E2=80=8B</div><div st=
yle=3D"font-family:arial,helvetica,sans-serif">- documentation using rustdo=
c and host on Github Pages</div><div style=3D"font-family:arial,helvetica,s=
ans-serif">=E2=80=8B- as a separate library, Rust bindings to libpcp_trace=
=E2=80=8B</div><div style=3D"font-family:arial,helvetica,sans-serif">- pub=
lish to=C2=A0<a href=3D"http://crates.io/" target=3D"_blank">crates.io</a>=
=E2=80=8B</div><div style=3D"font-family:arial,helvetica,sans-serif">-<div=
 class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;di=
splay:inline">=E2=80=8B create Rust examples showing usage of the API, and =
also =E2=80=8B</div>embedded this instrumentation capability to popular fra=
mework<div class=3D"gmail_default" style=3D"font-family:arial,helvetica,san=
s-serif;display:inline">=E2=80=8Bs=E2=80=8B</div> like<a href=3D"https://gi=
thub.com/hyperium/hyper" target=3D"_blank"> hyper</a><div class=3D"gmail_de=
fault" style=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=
=80=8B and=C2=A0<a href=3D"https://github.com/iron/iron" target=3D"_blank"=
>iron=E2=80=8B</a></div></div><div style=3D"font-family:arial,helvetica,san=
s-serif"><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,=
sans-serif">=E2=80=8B- as a stretch =E2=80=8Bgoal, implement a PCP agent in=
 Rust to export metrics directly, similar to parfait-agent</div></div><div =
style=3D"font-family:arial,helvetica,sans-serif"><br></div><div style=3D"fo=
nt-family:arial,helvetica,sans-serif">A major challenge in this project wou=
ld be that in Rust there is no universally safe way to deal with memory map=
ped files, as there are very few, if any at all, compile-time guarantees th=
e Rust compiler can make about reads and writes to an mmapped file. Hence, =
there&#39;s no support for it in the standard library. We&#39;ll have to wr=
ite our own little module around libc::mmap to get only the functionality w=
e need, or use a third party crate like=C2=A0<a href=3D"https://github.com/=
danburkert/memmap-rs" target=3D"_blank">memmap-rs</a>=C2=A0or=C2=A0<a href=
=3D"https://github.com/rbranson/rust-mmap" target=3D"_blank">rust-mmap</a>=
.<br></div><div style=3D"font-family:arial,helvetica,sans-serif"><br></div>=
</div><div style=3D"font-family:arial,helvetica,sans-serif" dir=3D"auto"><d=
iv style=3D"font-family:arial,helvetica,sans-serif;display:inline"><div cla=
ss=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;displa=
y:inline">=E2=80=8BDoes this outline look good enough to begin writing a pr=
oposal?=E2=80=8B<br></div></div></div><div style=3D"font-family:arial,helve=
tica,sans-serif" dir=3D"auto"><br></div><div style=3D"font-family:arial,hel=
vetica,sans-serif" dir=3D"auto">Thanks,</div><div style=3D"font-family:aria=
l,helvetica,sans-serif" dir=3D"auto">Saurav</div></div>
</div>
</div><br></div>

<div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div>
<hr>
Groups.io Links:<p>

You receive all messages sent to this group.


<p>

<a target=3D"_blank" href=3D"https://groups.io/g/pcp/message/15303">View/R=
eply Online (#15303)</a> |


  <a target=3D"_blank" href=3D"mailto:[email protected]?subject=3DRe:%20%5Bpcp=
%5D%20%5BGSoC%202017%5D%20Instrumentation%20of%20Rust%20applications">Reply=
 To Group</a>
  
    | <a target=3D"_blank" href=3D"mailto:?subject=3DRe:%20%5Bpcp%5D%20%5B=
GSoC%202017%5D%20Instrumentation%20of%20Rust%20applications">Reply To Sende=
r</a>
  


|


  <a target=3D"_blank" href=3D"https://groups.io/mt/4438976?uid=3D174580">=
Mute This Topic</a>
=20
| <a href=3D"https://groups.io/g/pcp/post">New Topic</a><br>




<p>pcp mailing list<br />[email protected]<br /><a href=3D"https://groups.io/g=
/pcp/messages" target=3D"_blank">https://groups.io/g/pcp/messages</a></p>

<a href=3D"https://groups.io/g/pcp/editsub?uid=3D174580">Change Your Subsc=
ription</a><br>
<a href=3D"https://groups.io/g/pcp">Group Home</a><br>
<a href=3D"mailto:[email protected]">Contact Group Owner</a><br>
<a href=3D"https://groups.io/static/tos">Terms Of Service</a><br>
<a href=3D"https://groups.io/g/pcp/leave/354243/563757577/xyzzy">Unsubscri=
be From This Group</a><br>

<div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div>


--f403045cf5f4de24f60549cf6cd4--