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

bcc-lua: build bcc.lua and bcc.o in the build tree #482

Merged
merged 1 commit into from
Apr 11, 2016
Merged

bcc-lua: build bcc.lua and bcc.o in the build tree #482

merged 1 commit into from
Apr 11, 2016

Conversation

markdrayton
Copy link
Contributor

The squishing/luajiting process during the build of bcc-lua writes a couple of files (bcc.lua and bcc.o) into the source tree. This change moves these files into the build tree so the source tree is untouched, consistent with the rest of the BCC build.

I'm not sure if this is the right way to do things (I've never touched cmake) as it looks like the rest of the build artifacts are written into src/lua/CMakeFiles/bcc-lua.dir/src:

mark@ubuntu:~/bcc/build$ find src/lua/ \( -name bcc.lua -o -name '*.o' \)
src/lua/CMakeFiles/bcc-lua.dir/src/main.c.o
src/lua/bcc.lua
src/lua/bcc.o

It's not immediately obvious how (or if I should) write these files into src/lua/CMakeFiles/bcc-lua.dir. Suggestions welcome if this isn't right (cc @vmg).

@drzaeus77
Copy link
Collaborator

The approach looks ok to me.

@4ast 4ast merged commit b51da5e into iovisor:master Apr 11, 2016
@vmg
Copy link
Contributor

vmg commented Apr 12, 2016

This looks like a nice change, but I'm afraid it breaks the build dependencies. Editing any of the lua files now doesn't cause the bcc-lua target to rebuild!

Let me see if I can figure out what exactly went wrong. :)

@markdrayton markdrayton deleted the lua-outside-source-build branch April 12, 2016 16:29
@markdrayton
Copy link
Contributor Author

Hrm, did my change break this or was it already broken? I checked out the commit before my change and it seems the problem of changed dependencies not rebuilding bcc-lua existed then too:

$ cd ~/bcc
$ git checkout c98ffd634ffa5c795e617e7fc0b2297709bed3b0
$ mkdir build; cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
$ make
$ md5sum src/lua/bcc-lua 
24418d605f0d6038fab1a77b49b7c2c1  src/lua/bcc-lua
$ vim ../src/lua/bcc/table.lua
$ git diff
diff --git a/src/lua/bcc/table.lua b/src/lua/bcc/table.lua
index 094a783..fcefd58 100644
--- a/src/lua/bcc/table.lua
+++ b/src/lua/bcc/table.lua
@@ -377,7 +377,7 @@ local function NewTable(bpf, name, key_type, leaf_type)
     leaf_type = _decode_table_type(desc)
   end

-  log.info("key = %s value = %s", key_type, leaf_type)
+  log.info("key = %s value = %s, id = %s", key_type, leaf_type, id)
   return table:new(bpf, id, fd, key_type, leaf_type)
 end

$ make
$ md5sum src/lua/bcc-lua                                                                                                                                      
24418d605f0d6038fab1a77b49b7c2c1  src/lua/bcc-lua

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.

None yet

4 participants