commit 055aa10e572ac5718337750dc466a4866589644b
parent c82a261730e531a57f4eed8895f0a96860aa35e1
Author: Kyle Milz <kyle@0x30.net>
Date: Thu, 11 Aug 2016 18:01:36 -0600
src: remove lines total from runtime interface
Diffstat:
6 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/gl_main.cc b/src/gl_main.cc
@@ -182,7 +182,6 @@ window::next_frame(View *vu)
std::stringstream ss;
ss << "program name:\t" << conn->m_progname << std::endl;
- ss << "code lines:\t" << conn->m_lines_total << std::endl;
ss << "trnsltn units:\t" << conn->m_num_tus << std::endl;
ss << "process id:\t" << conn->m_pid << std::endl;
ss << "parent pid:\t" << conn->m_ppid << std::endl;
diff --git a/src/runtime.c b/src/runtime.c
@@ -32,7 +32,6 @@
static struct citrun_node *nodes_head;
static uint32_t nodes_total;
-static uint32_t lines_total;
static void *relay_thread(void *);
@@ -46,10 +45,9 @@ citrun_node_add(uint8_t node_major, uint8_t node_minor, struct citrun_node *n)
/* Instrumented code and the runtime it links to are tightly bound. */
if (node_major != citrun_major || node_minor != citrun_minor) {
- warnx("libcitrun (v%i.%i): Node '%s' has mismatched version (v%i.%i)",
+ warnx("libcitrun-%i.%i: Node has mismatched version '%i.%i'",
citrun_major, citrun_minor,
- n->abs_file_path, node_major, node_minor);
- warnx("libcitrun: Try cleaning all object files and reinstrumenting.");
+ node_major, node_minor);
return;
}
@@ -64,7 +62,6 @@ citrun_node_add(uint8_t node_major, uint8_t node_minor, struct citrun_node *n)
err(1, "malloc");
nodes_total++;
- lines_total += n->size;
/* If the list is empty or we need to replace the list head */
if (nodes_head == NULL || nodes_head->size >= n->size) {
@@ -148,7 +145,6 @@ xwrite(int d, const void *buf, size_t bytes_total)
* Sent program wide values:
* - version major and minor
* - total number of translation units
- * - total number of lines in program
* - process id, parent process id, group process id
* - length of program name
* - program name
@@ -177,7 +173,6 @@ send_static(int fd)
xwrite(fd, &citrun_major, sizeof(citrun_major));
xwrite(fd, &citrun_minor, sizeof(citrun_minor));
xwrite(fd, &nodes_total, sizeof(nodes_total));
- xwrite(fd, &lines_total, sizeof(lines_total));
pids[0] = getpid();
pids[1] = getppid();
diff --git a/src/runtime_proc.cc b/src/runtime_proc.cc
@@ -32,7 +32,6 @@ RuntimeProcess::RuntimeProcess(af_unix &sock) :
assert(m_major == citrun_major);
m_socket.read_all(m_minor);
m_socket.read_all(m_num_tus);
- m_socket.read_all(m_lines_total);
m_socket.read_all(m_pid);
m_socket.read_all(m_ppid);
m_socket.read_all(m_pgrp);
diff --git a/src/runtime_proc.h b/src/runtime_proc.h
@@ -25,7 +25,6 @@ public:
std::string m_progname;
std::string m_cwd;
uint32_t m_num_tus;
- uint32_t m_lines_total;
pid_t m_pid;
pid_t m_ppid;
pid_t m_pgrp;
diff --git a/t/rt_static.t b/t/rt_static.t
@@ -1,6 +1,6 @@
use strict;
use Cwd;
-use Test::More tests => 22;
+use Test::More tests => 21;
use test::project;
use test::viewer;
@@ -13,7 +13,6 @@ $viewer->accept();
is( $viewer->{maj}, 0, "protocol major version" );
is( $viewer->{min}, 0, "protocol minor version" );
is( $viewer->{ntus}, 3, "translation unit count" );
-is( $viewer->{nlines}, 40, "total program lines" );
is( $viewer->{progname}, "program", "program name" );
is( $viewer->{cwd}, getcwd, "current working dir" );
is( @{ $viewer->{pids} }, 3, "number of pids" );
diff --git a/test/viewer.pm b/test/viewer.pm
@@ -31,7 +31,7 @@ sub accept {
# Protocol defined in src/runtime.c function send_static().
#
($self->{maj}, $self->{min}) = read_unpack($sock, 2, "C2");
- ($self->{ntus}, $self->{nlines}) = read_unpack($sock, 8, "L2");
+ ($self->{ntus}) = read_unpack($sock, 4, "L");
@{ $self->{pids} } = read_unpack($sock, 12, "L3");
$self->{progname} = read_all($sock, read_unpack($sock, 2, "S"));
$self->{cwd} = read_all($sock, read_unpack($sock, 2, "S"));